|
LLVM
10.0.0
|
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) | |
| void | clear () |
| Expected< std::unique_ptr< Instruction > > | createInstruction (const MCInst &MCI) |
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 38 of file InstrBuilder.h.
| llvm::mca::InstrBuilder::InstrBuilder | ( | const MCSubtargetInfo & | STI, |
| const MCInstrInfo & | MCII, | ||
| const MCRegisterInfo & | RI, | ||
| const MCInstrAnalysis * | IA | ||
| ) |
Definition at line 27 of file InstrBuilder.cpp.
References llvm::mca::computeProcResourceMasks(), llvm::MCSchedModel::getNumProcResourceKinds(), llvm::MCSubtargetInfo::getSchedModel(), and llvm::SmallVectorImpl< T >::resize().
|
inline |
Definition at line 65 of file InstrBuilder.h.
References createInstruction(), and llvm::DenseMap< KeyT, ValueT, KeyInfoT, BucketT >::shrink_and_clear().
| Expected< std::unique_ptr< Instruction > > llvm::mca::InstrBuilder::createInstruction | ( | const MCInst & | MCI | ) |
Definition at line 610 of file InstrBuilder.cpp.
References assert(), llvm::MCInstrAnalysis::clearsSuperRegisters(), D, llvm::MCInst::getOperand(), llvm::MCSchedModel::getProcessorID(), llvm::MCOperand::getReg(), llvm::MCSubtargetInfo::getSchedModel(), llvm::MCInstrAnalysis::isDependencyBreaking(), llvm::mca::ReadDescriptor::isImplicitRead(), llvm::mca::WriteDescriptor::isImplicitWrite(), llvm::MCInstrAnalysis::isOptimizableRegisterMove(), llvm::mca::WriteDescriptor::IsOptionalDef, llvm::MCOperand::isReg(), llvm::MCInstrAnalysis::isZeroIdiom(), llvm::BitmaskEnumDetail::Mask(), llvm::mca::WriteDescriptor::OpIndex, llvm::mca::ReadDescriptor::OpIndex, llvm::mca::InstrDesc::Reads, llvm::mca::WriteDescriptor::RegisterID, llvm::mca::ReadDescriptor::RegisterID, llvm::mca::ReadState::setIndependentFromDef(), llvm::Expected< T >::takeError(), llvm::mca::ReadDescriptor::UseIndex, and llvm::mca::InstrDesc::Writes.
Referenced by clear().
1.8.13