LLVM 20.0.0git
|
A builder class that knows how to construct Instruction objects. More...
#include "llvm/MCA/InstrBuilder.h"
Public Member Functions | |
InstrBuilder (const MCSubtargetInfo &STI, const MCInstrInfo &MCII, const MCRegisterInfo &RI, const MCInstrAnalysis *IA, const InstrumentManager &IM, unsigned CallLatency) | |
void | clear () |
void | setInstRecycleCallback (InstRecycleCallback CB) |
Set a callback which is invoked to retrieve a recycled mca::Instruction or null if there isn't any. | |
Expected< std::unique_ptr< Instruction > > | createInstruction (const MCInst &MCI, const SmallVector< Instrument * > &IVec) |
A builder class that knows how to construct Instruction objects.
Every llvm-mca Instruction is described by an object of class InstrDesc. An InstrDesc describes which registers are read/written by the instruction, as well as the instruction latency and hardware resources consumed.
This class is used by the tool to construct Instructions and instruction descriptors (i.e. InstrDesc objects). Information from the machine scheduling model is used to identify processor resources that are consumed by an instruction.
Definition at line 62 of file InstrBuilder.h.
llvm::mca::InstrBuilder::InstrBuilder | ( | const MCSubtargetInfo & | STI, |
const MCInstrInfo & | MCII, | ||
const MCRegisterInfo & | RI, | ||
const MCInstrAnalysis * | IA, | ||
const InstrumentManager & | IM, | ||
unsigned | CallLatency | ||
) |
Definition at line 31 of file InstrBuilder.cpp.
References llvm::mca::computeProcResourceMasks(), llvm::MCSchedModel::getNumProcResourceKinds(), llvm::MCSubtargetInfo::getSchedModel(), and llvm::SmallVectorImpl< T >::resize().
|
inline |
Definition at line 106 of file InstrBuilder.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::clear().
Expected< std::unique_ptr< Instruction > > llvm::mca::InstrBuilder::createInstruction | ( | const MCInst & | MCI, |
const SmallVector< Instrument * > & | IVec | ||
) |
Definition at line 678 of file InstrBuilder.cpp.
References assert(), llvm::MCSchedClassDesc::BeginGroup, llvm::MCInstrAnalysis::clearsSuperRegisters(), D, llvm::MCSchedClassDesc::EndGroup, llvm::MCInstrInfo::get(), llvm::mca::InstructionBase::getDefs(), llvm::MCInst::getOpcode(), llvm::MCInst::getOperand(), llvm::MCSchedModel::getProcessorID(), llvm::MCOperand::getReg(), llvm::MCSchedModel::getSchedClassDesc(), llvm::MCSubtargetInfo::getSchedModel(), llvm::mca::InstructionBase::getUses(), llvm::MCInstrDesc::hasUnmodeledSideEffects(), I, Idx, llvm::MCRegisterInfo::isConstant(), llvm::MCInstrAnalysis::isDependencyBreaking(), llvm::mca::ReadDescriptor::isImplicitRead(), llvm::mca::WriteDescriptor::isImplicitWrite(), llvm::MCInstrAnalysis::isOptimizableRegisterMove(), llvm::mca::WriteDescriptor::IsOptionalDef, llvm::MCInstrAnalysis::isZeroIdiom(), llvm::MCInstrDesc::mayLoad(), llvm::MCInstrDesc::mayStore(), llvm::mca::WriteDescriptor::OpIndex, llvm::mca::ReadDescriptor::OpIndex, llvm::mca::WriteDescriptor::RegisterID, llvm::mca::ReadDescriptor::RegisterID, llvm::mca::Instruction::reset(), llvm::MCSchedClassDesc::RetireOOO, llvm::mca::InstructionBase::setBeginGroup(), llvm::mca::InstructionBase::setEndGroup(), llvm::mca::InstructionBase::setHasSideEffects(), llvm::mca::ReadState::setIndependentFromDef(), llvm::mca::InstructionBase::setMayLoad(), llvm::mca::InstructionBase::setMayStore(), llvm::mca::InstructionBase::setOptimizableMove(), llvm::mca::InstructionBase::setRetireOOO(), llvm::size(), llvm::Expected< T >::takeError(), and llvm::mca::ReadDescriptor::UseIndex.
|
inline |
Set a callback which is invoked to retrieve a recycled mca::Instruction or null if there isn't any.
Definition at line 115 of file InstrBuilder.h.