23static_assert(std::is_trivial_v<MCSchedModel>,
24 "MCSchedModel is required to be a trivial type");
26 DefaultMicroOpBufferSize,
27 DefaultLoopMicroOpBufferSize,
30 DefaultMispredictPenalty,
46 DefIdx != DefEnd; ++DefIdx) {
59 unsigned SchedClass)
const {
71 const MCInst &Inst)
const {
76 if (!SCDesc->isValid())
80 unsigned SchedClass = 0;
81 while (SCDesc->isVariant()) {
88 assert(
false &&
"unsupported variant scheduling class");
99 std::optional<double> Throughput;
103 for (;
I != E; ++
I) {
104 if (!
I->ReleaseAtCycle)
107 double Temp = NumUnits * 1.0 /
I->ReleaseAtCycle;
108 Throughput = Throughput ? std::min(*Throughput, Temp) : Temp;
111 return 1.0 / *Throughput;
121 const MCInst &Inst)
const {
145 std::optional<double> Throughput;
148 for (;
I != E; ++
I) {
152 Throughput = Throughput ? std::min(*Throughput, Temp) : Temp;
155 return 1.0 / *Throughput;
164 unsigned WriteResourceID) {
170 if (E.WriteResourceID != WriteResourceID)
172 DelayCycles = std::min(DelayCycles, E.Cycles);
175 return std::abs(DelayCycles);
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Itinerary data supplied by a subtarget to be used by a target.
const InstrStage * beginStage(unsigned ItinClassIndx) const
Return the first stage of the itinerary.
const InstrStage * endStage(unsigned ItinClassIndx) const
Return the last+1 stage of the itinerary.
Instances of this class represent a single low-level machine instruction.
unsigned getOpcode() const
unsigned getSchedClass() const
Return the scheduling class for this instruction.
Interface to description of machine instruction set.
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode.
Generic base class for all target subtargets.
const MCWriteProcResEntry * getWriteProcResEnd(const MCSchedClassDesc *SC) const
virtual unsigned resolveVariantSchedClass(unsigned SchedClass, const MCInst *MI, const MCInstrInfo *MCII, unsigned CPUID) const
Resolve a variant scheduling class for the given MCInst and CPU.
const MCWriteLatencyEntry * getWriteLatencyEntry(const MCSchedClassDesc *SC, unsigned DefIdx) const
const MCWriteProcResEntry * getWriteProcResBegin(const MCSchedClassDesc *SC) const
Return an iterator at the first process resource consumed by the given scheduling class.
const MCSchedModel & getSchedModel() const
Get the machine model for this subtarget's CPU.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
int popcount(T Value) noexcept
Count the number of set bits in a value.
These values represent a non-pipelined step in the execution of an instruction.
Specify the number of cycles allowed after instruction issue before a particular use operand reads it...
Summarize the scheduling resources required for an instruction of a particular scheduling class.
uint16_t NumWriteLatencyEntries
Machine model for scheduling, bundling, and heuristics.
static const MCSchedModel Default
Returns the default initialized model.
static unsigned getForwardingDelayCycles(ArrayRef< MCReadAdvanceEntry > Entries, unsigned WriteResourceIdx=0)
Returns the maximum forwarding delay for register reads dependent on writes of scheduling class Write...
const MCSchedClassDesc * getSchedClassDesc(unsigned SchedClassIdx) const
unsigned getProcessorID() const
static int computeInstrLatency(const MCSubtargetInfo &STI, const MCSchedClassDesc &SCDesc)
Returns the latency value for the scheduling class.
friend class InstrItineraryData
const MCProcResourceDesc * getProcResource(unsigned ProcResourceIdx) const
static double getReciprocalThroughput(const MCSubtargetInfo &STI, const MCSchedClassDesc &SCDesc)
static const unsigned DefaultIssueWidth
Specify the latency in cpu cycles for a particular scheduling class and def index.
Identify one of the processor resource kinds consumed by a particular scheduling class for the specif...