16 #ifndef LLVM_CODEGEN_TARGETSCHEDULE_H 17 #define LLVM_CODEGEN_TARGETSCHEDULE_H 22 #include "llvm/Config/llvm-config.h" 29 class TargetInstrInfo;
41 unsigned MicroOpFactor;
119 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 142 return ResourceFactors[ResIdx];
148 return MicroOpFactor;
187 bool UseDefaultDefLatency =
true)
const;
188 unsigned computeInstrLatency(
const MCInst &Inst)
const;
189 unsigned computeInstrLatency(
unsigned Opcode)
const;
206 #endif // LLVM_CODEGEN_TARGETSCHEDULE_H
unsigned MicroOpBufferSize
ProcResIter getWriteProcResBegin(const MCSchedClassDesc *SC) const
This class represents lattice values for constants.
double computeReciprocalThroughput(const MachineInstr *MI) const
Compute the reciprocal throughput of the given instruction.
const MCProcResourceDesc * getProcResource(unsigned ProcResourceIdx) const
unsigned computeOperandLatency(const MachineInstr *DefMI, unsigned DefOperIdx, const MachineInstr *UseMI, unsigned UseOperIdx) const
Compute operand latency based on the available machine model.
ProcResIter getWriteProcResEnd(const MCSchedClassDesc *SC) const
unsigned getProcessorID() const
unsigned getMicroOpBufferSize() const
Number of micro-ops that may be buffered for OOO execution.
bool hasInstrSchedModelOrItineraries() const
Return true if this machine model includes an instruction-level scheduling model or cycle-to-cycle it...
const TargetSubtargetInfo * getSubtargetInfo() const
TargetSubtargetInfo getter.
Provide an instruction scheduling machine model to CodeGen passes.
const InstrItineraryData * getInstrItineraries() const
bool hasInstrSchedModel() const
Return true if this machine model includes an instruction-level scheduling model. ...
unsigned getNumMicroOps(const MachineInstr *MI, const MCSchedClassDesc *SC=nullptr) const
Return the number of issue slots required for this MI.
const MCWriteProcResEntry * getWriteProcResEnd(const MCSchedClassDesc *SC) const
Itinerary data supplied by a subtarget to be used by a target.
Instances of this class represent a single low-level machine instruction.
const char * getResourceName(unsigned PIdx) const
TargetInstrInfo - Interface to description of machine instruction set.
Identify one of the processor resource kinds consumed by a particular scheduling class for the specif...
MachineInstrBuilder & UseMI
Summarize the scheduling resources required for an instruction of a particular scheduling class...
unsigned getLatencyFactor() const
Multiply cycle count by this factor to normalize it relative to other resources.
unsigned getProcessorID() const
Identify the processor corresponding to the current subtarget.
int getResourceBufferSize(unsigned PIdx) const
Number of resource units that may be buffered for OOO execution.
const MCSchedModel * getMCSchedModel() const
void init(const TargetSubtargetInfo *TSInfo)
Initialize the machine model for instruction scheduling.
bool mustEndGroup(const MachineInstr *MI, const MCSchedClassDesc *SC=nullptr) const
Return true if current group must end.
bool mustBeginGroup(const MachineInstr *MI, const MCSchedClassDesc *SC=nullptr) const
Return true if new group must begin.
Define a kind of processor resource that will be modeled by the scheduler.
MachineInstrBuilder MachineInstrBuilder & DefMI
unsigned getMicroOpFactor() const
Multiply number of micro-ops by this factor to normalize it relative to other resources.
CHAIN = SC CHAIN, Imm128 - System call.
bool hasInstrItineraries() const
Return true if this machine model includes cycle-to-cycle itinerary data.
unsigned getResourceFactor(unsigned ResIdx) const
Multiply the number of units consumed for a resource by this factor to normalize it relative to other...
unsigned getNumProcResourceKinds() const
Get the number of kinds of resources for this target.
unsigned computeOutputLatency(const MachineInstr *DefMI, unsigned DefOperIdx, const MachineInstr *DepMI) const
Output dependency latency of a pair of defs of the same register.
const MCSchedClassDesc * resolveSchedClass(const MachineInstr *MI) const
Return the MCSchedClassDesc for this instruction.
TargetSubtargetInfo - Generic base class for all target subtargets.
Representation of each machine instruction.
const MCWriteProcResEntry * getWriteProcResBegin(const MCSchedClassDesc *SC) const
Return an iterator at the first process resource consumed by the given scheduling class...
const MCProcResourceDesc * getProcResource(unsigned PIdx) const
Get a processor resource by ID for convenience.
const TargetInstrInfo * getInstrInfo() const
TargetInstrInfo getter.
unsigned getIssueWidth() const
Maximum number of micro-ops that may be scheduled per cycle.
Machine model for scheduling, bundling, and heuristics.
unsigned getNumProcResourceKinds() const