LLVM 20.0.0git
Public Member Functions | List of all members
llvm::mca::InstrBuilder Class Reference

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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ InstrBuilder()

llvm::mca::InstrBuilder::InstrBuilder ( const MCSubtargetInfo STI,
const MCInstrInfo MCII,
const MCRegisterInfo RI,
const MCInstrAnalysis IA,
const InstrumentManager IM,
unsigned  CallLatency 
)

Member Function Documentation

◆ clear()

void llvm::mca::InstrBuilder::clear ( )
inline

◆ createInstruction()

Expected< std::unique_ptr< Instruction > > llvm::mca::InstrBuilder::createInstruction ( const MCInst MCI,
const SmallVector< Instrument * > &  IVec 
)

Definition at line 677 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.

◆ setInstRecycleCallback()

void llvm::mca::InstrBuilder::setInstRecycleCallback ( InstRecycleCallback  CB)
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.


The documentation for this class was generated from the following files: