LLVM 22.0.0git
llvm::mca::Stage Class Referenceabstract

#include "llvm/MCA/Stages/Stage.h"

Inheritance diagram for llvm::mca::Stage:
[legend]

Public Member Functions

 Stage ()=default
virtual ~Stage ()
virtual bool isAvailable (const InstRef &IR) const
 Returns true if it can execute IR during this cycle.
virtual bool hasWorkToComplete () const =0
 Returns true if some instructions are still executing this stage.
virtual Error cycleStart ()
 Called once at the start of each cycle.
virtual Error cycleResume ()
 Called after the pipeline is resumed from pausing state.
virtual Error cycleEnd ()
 Called once at the end of each cycle.
virtual Error execute (InstRef &IR)=0
 The primary action that this stage performs on instruction IR.
void setNextInSequence (Stage *NextStage)
bool checkNextStage (const InstRef &IR) const
Error moveToTheNextStage (InstRef &IR)
 Called when an instruction is ready to move the next pipeline stage.
void addListener (HWEventListener *Listener)
 Add a listener to receive callbacks during the execution of this stage.
template<typename EventT>
void notifyEvent (const EventT &Event) const
 Notify listeners of a particular hardware event.

Protected Member Functions

const std::set< HWEventListener * > & getListeners () const

Detailed Description

Definition at line 28 of file Stage.h.

Constructor & Destructor Documentation

◆ Stage()

llvm::mca::Stage::Stage ( )
default

◆ ~Stage()

llvm::mca::Stage::~Stage ( )
virtualdefault

Member Function Documentation

◆ addListener()

void llvm::mca::Stage::addListener ( HWEventListener * Listener)

Add a listener to receive callbacks during the execution of this stage.

Definition at line 23 of file Stage.cpp.

◆ checkNextStage()

bool llvm::mca::Stage::checkNextStage ( const InstRef & IR) const
inline

Definition at line 66 of file Stage.h.

References IR.

Referenced by llvm::mca::EntryStage::isAvailable(), and moveToTheNextStage().

◆ cycleEnd()

virtual Error llvm::mca::Stage::cycleEnd ( )
inlinevirtual

Called once at the end of each cycle.

Reimplemented in llvm::mca::EntryStage, llvm::mca::ExecuteStage, llvm::mca::InOrderIssueStage, llvm::mca::MicroOpQueueStage, and llvm::mca::RetireStage.

Definition at line 56 of file Stage.h.

◆ cycleResume()

virtual Error llvm::mca::Stage::cycleResume ( )
inlinevirtual

Called after the pipeline is resumed from pausing state.

Reimplemented in llvm::mca::EntryStage.

Definition at line 53 of file Stage.h.

◆ cycleStart()

virtual Error llvm::mca::Stage::cycleStart ( )
inlinevirtual

Called once at the start of each cycle.

This can be used as a setup phase to prepare for the executions during the cycle.

Reimplemented in llvm::mca::DispatchStage, llvm::mca::EntryStage, llvm::mca::ExecuteStage, llvm::mca::InOrderIssueStage, llvm::mca::MicroOpQueueStage, and llvm::mca::RetireStage.

Definition at line 50 of file Stage.h.

◆ execute()

virtual Error llvm::mca::Stage::execute ( InstRef & IR)
pure virtual

◆ getListeners()

const std::set< HWEventListener * > & llvm::mca::Stage::getListeners ( ) const
inlineprotected

◆ hasWorkToComplete()

virtual bool llvm::mca::Stage::hasWorkToComplete ( ) const
pure virtual

◆ isAvailable()

virtual bool llvm::mca::Stage::isAvailable ( const InstRef & IR) const
inlinevirtual

Returns true if it can execute IR during this cycle.

Reimplemented in llvm::mca::DispatchStage, llvm::mca::EntryStage, llvm::mca::ExecuteStage, llvm::mca::InOrderIssueStage, and llvm::mca::MicroOpQueueStage.

Definition at line 43 of file Stage.h.

References IR.

◆ moveToTheNextStage()

Error llvm::mca::Stage::moveToTheNextStage ( InstRef & IR)
inline

Called when an instruction is ready to move the next pipeline stage.

Stages are responsible for moving instructions to their immediate successor stages.

Definition at line 74 of file Stage.h.

References assert(), checkNextStage(), and IR.

Referenced by llvm::mca::ExecuteStage::cycleStart(), and llvm::mca::EntryStage::execute().

◆ notifyEvent()

◆ setNextInSequence()

void llvm::mca::Stage::setNextInSequence ( Stage * NextStage)
inline

Definition at line 61 of file Stage.h.

References assert().


The documentation for this class was generated from the following files: