LLVM: llvm::TargetSchedModel Class Reference (original) (raw)

Provide an instruction scheduling machine model to CodeGen passes. More...

#include "[llvm/CodeGen/TargetSchedule.h](TargetSchedule%5F8h%5Fsource.html)"

Public Member Functions
TargetSchedModel ()
LLVM_ABI void init (const TargetSubtargetInfo *TSInfo, bool EnableSModel=true, bool EnableSItins=true)
Initialize the machine model for instruction scheduling.
LLVM_ABI const MCSchedClassDesc * resolveSchedClass (const MachineInstr *MI) const
Return the MCSchedClassDesc for this instruction.
const TargetSubtargetInfo * getSubtargetInfo () const
TargetSubtargetInfo getter.
const TargetInstrInfo * getInstrInfo () const
TargetInstrInfo getter.
LLVM_ABI bool hasInstrSchedModel () const
Return true if this machine model includes an instruction-level scheduling model.
const MCSchedModel * getMCSchedModel () const
LLVM_ABI bool hasInstrItineraries () const
Return true if this machine model includes cycle-to-cycle itinerary data.
const InstrItineraryData * getInstrItineraries () const
bool hasInstrSchedModelOrItineraries () const
Return true if this machine model includes an instruction-level scheduling model or cycle-to-cycle itinerary data.
LLVM_ABI bool enableIntervals () const
unsigned getProcessorID () const
Identify the processor corresponding to the current subtarget.
unsigned getIssueWidth () const
Maximum number of micro-ops that may be scheduled per cycle.
LLVM_ABI bool mustBeginGroup (const MachineInstr *MI, const MCSchedClassDesc *SC=nullptr) const
Return true if new group must begin.
LLVM_ABI bool mustEndGroup (const MachineInstr *MI, const MCSchedClassDesc *SC=nullptr) const
Return true if current group must end.
LLVM_ABI unsigned getNumMicroOps (const MachineInstr *MI, const MCSchedClassDesc *SC=nullptr) const
Return the number of issue slots required for this MI.
unsigned getNumProcResourceKinds () const
Get the number of kinds of resources for this target.
const MCProcResourceDesc * getProcResource (unsigned PIdx) const
Get a processor resource by ID for convenience.
const char * getResourceName (unsigned PIdx) const
ProcResIter getWriteProcResBegin (const MCSchedClassDesc *SC) const
ProcResIter getWriteProcResEnd (const MCSchedClassDesc *SC) const
unsigned getResourceFactor (unsigned ResIdx) const
Multiply the number of units consumed for a resource by this factor to normalize it relative to other resources.
unsigned getMicroOpFactor () const
Multiply number of micro-ops by this factor to normalize it relative to other resources.
unsigned getLatencyFactor () const
Multiply cycle count by this factor to normalize it relative to other resources.
unsigned getMicroOpBufferSize () const
Number of micro-ops that may be buffered for OOO execution.
int getResourceBufferSize (unsigned PIdx) const
Number of resource units that may be buffered for OOO execution.
LLVM_ABI unsigned computeOperandLatency (const MachineInstr *DefMI, unsigned DefOperIdx, const MachineInstr *UseMI, unsigned UseOperIdx) const
Compute operand latency based on the available machine model.
LLVM_ABI unsigned computeInstrLatency (const MachineInstr *MI, bool UseDefaultDefLatency=true) const
Compute the instruction latency based on the available machine model.
LLVM_ABI unsigned computeInstrLatency (const MCInst &Inst) const
LLVM_ABI unsigned computeInstrLatency (unsigned Opcode) const
LLVM_ABI unsigned computeOutputLatency (const MachineInstr *DefMI, unsigned DefOperIdx, const MachineInstr *DepMI) const
Output dependency latency of a pair of defs of the same register.
LLVM_ABI double computeReciprocalThroughput (const MachineInstr *MI) const
Compute the reciprocal throughput of the given instruction.
LLVM_ABI double computeReciprocalThroughput (const MCInst &MI) const
LLVM_ABI double computeReciprocalThroughput (unsigned Opcode) const

Provide an instruction scheduling machine model to CodeGen passes.

Definition at line 31 of file TargetSchedule.h.

ProcResIter

llvm::TargetSchedModel::TargetSchedModel ( ) inline

computeInstrLatency() [1/3]

Compute the instruction latency based on the available machine model.

Compute and return the expected latency of this instruction independent of a particular use. computeOperandLatency is the preferred API, but this is occasionally useful to help estimate instruction cost.

If UseDefaultDefLatency is false and no new machine sched model is present this method falls back to TII->getInstrLatency with an empty instruction itinerary (this is so we preserve the previous behavior of the if converter after moving it to TargetSchedModel).

Definition at line 253 of file TargetSchedule.cpp.

References hasInstrItineraries(), hasInstrSchedModel(), llvm::MCSchedClassDesc::isValid(), MI, and resolveSchedClass().

computeInstrLatency() [2/3]

computeInstrLatency() [3/3]

computeOperandLatency()

Compute operand latency based on the available machine model.

Compute and return the latency of the given data dependent def and use when the operand indices are already known. UseMI may be NULL for an unknown user.

Definition at line 169 of file TargetSchedule.cpp.

References capLatency(), llvm::MCWriteLatencyEntry::Cycles, DefMI, llvm::errs(), findDefIdx(), findUseIdx(), hasInstrItineraries(), hasInstrSchedModel(), llvm::MCSchedClassDesc::isValid(), llvm::Latency, llvm_unreachable, llvm::MCSchedClassDesc::NumReadAdvanceEntries, resolveSchedClass(), UseMI, and llvm::MCWriteLatencyEntry::WriteResourceID.

Referenced by llvm::AArch64Subtarget::adjustSchedDependency(), pushDepHeight(), and updatePhysDepsUpwards().

computeOutputLatency()

computeReciprocalThroughput() [1/3]

double TargetSchedModel::computeReciprocalThroughput ( const MachineInstr * MI ) const

computeReciprocalThroughput() [2/3]

double TargetSchedModel::computeReciprocalThroughput ( const MCInst & MI ) const

computeReciprocalThroughput() [3/3]

double TargetSchedModel::computeReciprocalThroughput ( unsigned Opcode ) const

enableIntervals()

bool TargetSchedModel::enableIntervals ( ) const

getInstrInfo()

getInstrItineraries()

getIssueWidth()

unsigned llvm::TargetSchedModel::getIssueWidth ( ) const inline

getLatencyFactor()

unsigned llvm::TargetSchedModel::getLatencyFactor ( ) const inline

Multiply cycle count by this factor to normalize it relative to other resources.

This is the number of resource units per cycle.

Definition at line 168 of file TargetSchedule.h.

getMCSchedModel()

getMicroOpBufferSize()

unsigned llvm::TargetSchedModel::getMicroOpBufferSize ( ) const inline

getMicroOpFactor()

unsigned llvm::TargetSchedModel::getMicroOpFactor ( ) const inline

getNumMicroOps()

getNumProcResourceKinds()

unsigned llvm::TargetSchedModel::getNumProcResourceKinds ( ) const inline

getProcessorID()

unsigned llvm::TargetSchedModel::getProcessorID ( ) const inline

Identify the processor corresponding to the current subtarget.

Definition at line 108 of file TargetSchedule.h.

getProcResource()

getResourceBufferSize()

int llvm::TargetSchedModel::getResourceBufferSize ( unsigned PIdx) const inline

Number of resource units that may be buffered for OOO execution.

Returns

The buffer size in resource units or -1 for unlimited.

Definition at line 177 of file TargetSchedule.h.

getResourceFactor()

unsigned llvm::TargetSchedModel::getResourceFactor ( unsigned ResIdx) const inline

getResourceName()

getSubtargetInfo()

getWriteProcResBegin()

getWriteProcResEnd()

hasInstrItineraries()

bool TargetSchedModel::hasInstrItineraries ( ) const

hasInstrSchedModel()

bool TargetSchedModel::hasInstrSchedModel ( ) const

Return true if this machine model includes an instruction-level scheduling model.

This is more detailed than the course grain IssueWidth and default latency properties, but separate from the per-cycle itinerary data.

Definition at line 35 of file TargetSchedule.cpp.

Referenced by computeInstrLatency(), computeInstrLatency(), computeInstrLatency(), computeOperandLatency(), computeOutputLatency(), computeReciprocalThroughput(), computeReciprocalThroughput(), computeReciprocalThroughput(), getNumMicroOps(), hasInstrSchedModelOrItineraries(), llvm::SchedRemainder::init(), mustBeginGroup(), mustEndGroup(), and shouldCheckPending().

hasInstrSchedModelOrItineraries()

bool llvm::TargetSchedModel::hasInstrSchedModelOrItineraries ( ) const inline

init()

mustBeginGroup()

mustEndGroup()

resolveSchedClass()


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