16 #ifndef LLVM_MCA_STAGE_H 17 #define LLVM_MCA_STAGE_H 29 Stage *NextInSequence;
30 std::set<HWEventListener *> Listeners;
36 const std::set<HWEventListener *> &
getListeners()
const {
return Listeners; }
39 Stage() : NextInSequence(nullptr) {}
59 assert(!NextInSequence &&
"This stage already has a NextInSequence!");
60 NextInSequence = NextStage;
64 return NextInSequence && NextInSequence->
isAvailable(IR);
73 return NextInSequence->
execute(IR);
80 template <
typename EventT>
void notifyEvent(
const EventT &Event)
const {
88 #endif // LLVM_MCA_STAGE_H void notifyEvent(const EventT &Event) const
Notify listeners of a particular hardware event.
This class represents lattice values for constants.
virtual Error execute(InstRef &IR)=0
The primary action that this stage performs on instruction IR.
const std::set< HWEventListener * > & getListeners() const
Subclass of Error for the sole purpose of identifying the success path in the type system...
bool checkNextStage(const InstRef &IR) const
An InstRef contains both a SourceMgr index and Instruction pair.
virtual Error cycleStart()
Called once at the start of each cycle.
void addListener(HWEventListener *Listener)
Add a listener to receive callbacks during the execution of this stage.
virtual bool isAvailable(const InstRef &IR) const
Returns true if it can execute IR during this cycle.
virtual Error cycleEnd()
Called once at the end of each cycle.
This file defines the main interface for hardware event listeners.
virtual void onEvent(const HWInstructionEvent &Event)
Error moveToTheNextStage(InstRef &IR)
Called when an instruction is ready to move the next pipeline stage.
virtual bool hasWorkToComplete() const =0
Returns true if some instructions are still executing this stage.
void setNextInSequence(Stage *NextStage)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Lightweight error class with error context and mandatory checking.
Statically lint checks LLVM IR