15#ifndef LLVM_CODEGEN_TARGETSCHEDULE_H
16#define LLVM_CODEGEN_TARGETSCHEDULE_H
20#include "llvm/Config/llvm-config.h"
41 unsigned MicroOpFactor = 0;
44 unsigned ResourceLCM = 0;
121#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
144 return ResourceFactors[ResIdx];
150 return MicroOpFactor;
189 bool UseDefaultDefLatency =
true)
const;
190 unsigned computeInstrLatency(
const MCInst &Inst)
const;
191 unsigned computeInstrLatency(
unsigned Opcode)
const;
MachineInstrBuilder & UseMI
MachineInstrBuilder MachineInstrBuilder & DefMI
const HexagonInstrInfo * TII
This file defines the SmallVector class.
Itinerary data supplied by a subtarget to be used by a target.
Instances of this class represent a single low-level machine instruction.
const MCWriteProcResEntry * getWriteProcResEnd(const MCSchedClassDesc *SC) const
const MCWriteProcResEntry * getWriteProcResBegin(const MCSchedClassDesc *SC) const
Return an iterator at the first process resource consumed by the given scheduling class.
Representation of each machine instruction.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
TargetInstrInfo - Interface to description of machine instruction set.
Provide an instruction scheduling machine model to CodeGen passes.
const char * getResourceName(unsigned PIdx) const
const MCSchedModel * getMCSchedModel() const
const TargetInstrInfo * getInstrInfo() const
TargetInstrInfo getter.
bool mustEndGroup(const MachineInstr *MI, const MCSchedClassDesc *SC=nullptr) const
Return true if current group must end.
unsigned getIssueWidth() const
Maximum number of micro-ops that may be scheduled per cycle.
unsigned getMicroOpFactor() const
Multiply number of micro-ops by this factor to normalize it relative to other resources.
ProcResIter getWriteProcResEnd(const MCSchedClassDesc *SC) const
int getResourceBufferSize(unsigned PIdx) const
Number of resource units that may be buffered for OOO execution.
bool hasInstrSchedModel() const
Return true if this machine model includes an instruction-level scheduling model.
unsigned computeOutputLatency(const MachineInstr *DefMI, unsigned DefOperIdx, const MachineInstr *DepMI) const
Output dependency latency of a pair of defs of the same register.
bool mustBeginGroup(const MachineInstr *MI, const MCSchedClassDesc *SC=nullptr) const
Return true if new group must begin.
unsigned getLatencyFactor() const
Multiply cycle count by this factor to normalize it relative to other resources.
unsigned getResourceFactor(unsigned ResIdx) const
Multiply the number of units consumed for a resource by this factor to normalize it relative to other...
const MCSchedClassDesc * resolveSchedClass(const MachineInstr *MI) const
Return the MCSchedClassDesc for this instruction.
void init(const TargetSubtargetInfo *TSInfo)
Initialize the machine model for instruction scheduling.
unsigned computeOperandLatency(const MachineInstr *DefMI, unsigned DefOperIdx, const MachineInstr *UseMI, unsigned UseOperIdx) const
Compute operand latency based on the available machine model.
bool hasInstrSchedModelOrItineraries() const
Return true if this machine model includes an instruction-level scheduling model or cycle-to-cycle it...
unsigned getMicroOpBufferSize() const
Number of micro-ops that may be buffered for OOO execution.
double computeReciprocalThroughput(const MachineInstr *MI) const
Compute the reciprocal throughput of the given instruction.
unsigned getNumMicroOps(const MachineInstr *MI, const MCSchedClassDesc *SC=nullptr) const
Return the number of issue slots required for this MI.
const MCProcResourceDesc * getProcResource(unsigned PIdx) const
Get a processor resource by ID for convenience.
unsigned getNumProcResourceKinds() const
Get the number of kinds of resources for this target.
unsigned getProcessorID() const
Identify the processor corresponding to the current subtarget.
const InstrItineraryData * getInstrItineraries() const
const TargetSubtargetInfo * getSubtargetInfo() const
TargetSubtargetInfo getter.
bool enableIntervals() const
ProcResIter getWriteProcResBegin(const MCSchedClassDesc *SC) const
bool hasInstrItineraries() const
Return true if this machine model includes cycle-to-cycle itinerary data.
TargetSubtargetInfo - Generic base class for all target subtargets.
This is an optimization pass for GlobalISel generic memory operations.
@ Default
The result values are uniform if and only if all operands are uniform.
Define a kind of processor resource that will be modeled by the scheduler.
Summarize the scheduling resources required for an instruction of a particular scheduling class.
Machine model for scheduling, bundling, and heuristics.
unsigned getProcessorID() const
unsigned getNumProcResourceKinds() const
unsigned MicroOpBufferSize
const MCProcResourceDesc * getProcResource(unsigned ProcResourceIdx) const
Identify one of the processor resource kinds consumed by a particular scheduling class for the specif...