15#ifndef LLVM_MCA_STAGES_STAGE_H
16#define LLVM_MCA_STAGES_STAGE_H
28 Stage *NextInSequence =
nullptr;
29 std::set<HWEventListener *> Listeners;
35 const std::set<HWEventListener *> &
getListeners()
const {
return Listeners; }
61 assert(!NextInSequence &&
"This stage already has a NextInSequence!");
62 NextInSequence = NextStage;
82 template <
typename EventT>
void notifyEvent(
const EventT &Event)
const {
84 Listener->onEvent(Event);
This file defines the main interface for hardware event listeners.
Legalize the Machine IR a function s Machine IR
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Base class for user error types.
Subclass of Error for the sole purpose of identifying the success path in the type system.
Lightweight error class with error context and mandatory checking.
An InstRef contains both a SourceMgr index and Instruction pair.
void addListener(HWEventListener *Listener)
Add a listener to receive callbacks during the execution of this stage.
virtual Error cycleEnd()
Called once at the end of each cycle.
Error moveToTheNextStage(InstRef &IR)
Called when an instruction is ready to move the next pipeline stage.
void notifyEvent(const EventT &Event) const
Notify listeners of a particular hardware event.
bool checkNextStage(const InstRef &IR) const
virtual bool isAvailable(const InstRef &IR) const
Returns true if it can execute IR during this cycle.
virtual Error cycleStart()
Called once at the start of each cycle.
virtual Error execute(InstRef &IR)=0
The primary action that this stage performs on instruction IR.
const std::set< HWEventListener * > & getListeners() const
virtual bool hasWorkToComplete() const =0
Returns true if some instructions are still executing this stage.
void setNextInSequence(Stage *NextStage)
virtual Error cycleResume()
Called after the pipeline is resumed from pausing state.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
This is actually not an error but a marker to indicate that the instruction stream is paused.
std::error_code convertToErrorCode() const override
Convert this error to a std::error_code.
void log(raw_ostream &OS) const override
Print an error message to an output stream.