LLVM 20.0.0git
|
Class which can be overriden by targets to enforce instruction dependencies and behaviours that aren't expressed well enough within the scheduling model for mca to automatically simulate them properly. More...
#include "llvm/MCA/CustomBehaviour.h"
Public Member Functions | |
CustomBehaviour (const MCSubtargetInfo &STI, const mca::SourceMgr &SrcMgr, const MCInstrInfo &MCII) | |
virtual | ~CustomBehaviour () |
virtual unsigned | checkCustomHazard (ArrayRef< InstRef > IssuedInst, const InstRef &IR) |
Before the llvm-mca pipeline dispatches an instruction, it first checks for any register or resource dependencies / hazards. | |
virtual std::vector< std::unique_ptr< View > > | getStartViews (llvm::MCInstPrinter &IP, llvm::ArrayRef< llvm::MCInst > Insts) |
Return a vector of Views that will be added before all other Views. | |
virtual std::vector< std::unique_ptr< View > > | getPostInstrInfoViews (llvm::MCInstPrinter &IP, llvm::ArrayRef< llvm::MCInst > Insts) |
Return a vector of Views that will be added after the InstructionInfoView. | |
virtual std::vector< std::unique_ptr< View > > | getEndViews (llvm::MCInstPrinter &IP, llvm::ArrayRef< llvm::MCInst > Insts) |
Return a vector of Views that will be added after all other Views. | |
Protected Attributes | |
const MCSubtargetInfo & | STI |
const mca::SourceMgr & | SrcMgr |
const MCInstrInfo & | MCII |
Class which can be overriden by targets to enforce instruction dependencies and behaviours that aren't expressed well enough within the scheduling model for mca to automatically simulate them properly.
If you implement this class for your target, make sure to also implement a target specific InstrPostProcess class as well.
Definition at line 66 of file CustomBehaviour.h.
|
inline |
Definition at line 73 of file CustomBehaviour.h.
|
virtualdefault |
|
virtual |
Before the llvm-mca pipeline dispatches an instruction, it first checks for any register or resource dependencies / hazards.
If it doesn't find any, this method will be invoked to determine if there are any custom hazards that the instruction needs to wait for. The return value of this method is the number of cycles that the instruction needs to wait for. It's safe to underestimate the number of cycles to wait for since these checks will be invoked again before the intruction gets dispatched. However, it's not safe (accurate) to overestimate the number of cycles to wait for since the instruction will wait for AT LEAST that number of cycles before attempting to be dispatched again.
Reimplemented in llvm::mca::AMDGPUCustomBehaviour.
Definition at line 21 of file CustomBehaviour.cpp.
|
virtual |
Return a vector of Views that will be added after all other Views.
Definition at line 40 of file CustomBehaviour.cpp.
|
virtual |
Return a vector of Views that will be added after the InstructionInfoView.
Definition at line 34 of file CustomBehaviour.cpp.
|
virtual |
Return a vector of Views that will be added before all other Views.
Definition at line 28 of file CustomBehaviour.cpp.
|
protected |
Definition at line 70 of file CustomBehaviour.h.
|
protected |
Definition at line 69 of file CustomBehaviour.h.
|
protected |
Definition at line 68 of file CustomBehaviour.h.