LLVM  10.0.0svn
Public Member Functions | Protected Member Functions | List of all members
llvm::mca::Stage Class Referenceabstract

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

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

Public Member Functions

 Stage ()
 
virtual ~Stage ()
 
virtual bool isAvailable (const InstRef &IR) const
 Returns true if it can execute IR during this cycle. More...
 
virtual bool hasWorkToComplete () const =0
 Returns true if some instructions are still executing this stage. More...
 
virtual Error cycleStart ()
 Called once at the start of each cycle. More...
 
virtual Error cycleEnd ()
 Called once at the end of each cycle. More...
 
virtual Error execute (InstRef &IR)=0
 The primary action that this stage performs on instruction IR. More...
 
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. More...
 
void addListener (HWEventListener *Listener)
 Add a listener to receive callbacks during the execution of this stage. More...
 
template<typename EventT >
void notifyEvent (const EventT &Event) const
 Notify listeners of a particular hardware event. More...
 

Protected Member Functions

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

Detailed Description

Definition at line 27 of file Stage.h.

Constructor & Destructor Documentation

◆ Stage()

llvm::mca::Stage::Stage ( )
inline

Definition at line 38 of file Stage.h.

References ~Stage().

◆ ~Stage()

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

Referenced by Stage().

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.

Referenced by moveToTheNextStage().

◆ checkNextStage()

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

◆ cycleEnd()

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

Called once at the end of each cycle.

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

Definition at line 52 of file Stage.h.

References execute(), and IR.

◆ 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::MicroOpQueueStage, llvm::mca::DispatchStage, llvm::mca::ExecuteStage, llvm::mca::EntryStage, and llvm::mca::RetireStage.

Definition at line 49 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

Returns true if some instructions are still executing this stage.

Implemented in llvm::mca::DispatchStage, llvm::mca::MicroOpQueueStage, llvm::mca::ExecuteStage, llvm::mca::EntryStage, llvm::mca::RetireStage, and llvm::mca::InstructionTables.

Referenced by isAvailable().

◆ 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::MicroOpQueueStage, llvm::mca::ExecuteStage, and llvm::mca::EntryStage.

Definition at line 42 of file Stage.h.

References hasWorkToComplete().

Referenced by checkNextStage().

◆ 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 70 of file Stage.h.

References addListener(), assert(), checkNextStage(), and execute().

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

◆ notifyEvent()

template<typename EventT >
void llvm::mca::Stage::notifyEvent ( const EventT &  Event) const
inline

Notify listeners of a particular hardware event.

Definition at line 79 of file Stage.h.

References llvm::mca::HWEventListener::onEvent().

Referenced by llvm::mca::ExecuteStage::cycleEnd().

◆ setNextInSequence()

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

Definition at line 57 of file Stage.h.

References assert().

Referenced by llvm::mca::Pipeline::appendStage().


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