16 #ifndef LLVM_MC_MCINSTRITINERARIES_H 17 #define LLVM_MC_MCINSTRITINERARIES_H 87 return (NextCycles_ >= 0) ? (
unsigned)NextCycles_ : Cycles_;
112 const unsigned *OperandCycles =
nullptr;
113 const unsigned *Forwardings =
nullptr;
119 const unsigned *OS,
const unsigned *
F)
120 : SchedModel(SM), Stages(S), OperandCycles(OS), Forwardings(F),
121 Itineraries(SchedModel.InstrItineraries) {}
124 bool isEmpty()
const {
return Itineraries ==
nullptr; }
128 return ((Itineraries[ItinClassIndx].FirstStage == UINT16_MAX) &&
129 (Itineraries[ItinClassIndx].LastStage == UINT16_MAX));
134 unsigned StageIdx = Itineraries[ItinClassIndx].
FirstStage;
135 return Stages + StageIdx;
140 unsigned StageIdx = Itineraries[ItinClassIndx].
LastStage;
141 return Stages + StageIdx;
154 unsigned Latency = 0, StartCycle = 0;
155 for (
const InstrStage *IS = beginStage(ItinClassIndx),
156 *
E = endStage(ItinClassIndx); IS !=
E; ++IS) {
157 Latency =
std::max(Latency, StartCycle + IS->getCycles());
158 StartCycle += IS->getNextCycles();
171 if ((FirstIdx + OperandIdx) >= LastIdx)
174 return (
int)OperandCycles[FirstIdx + OperandIdx];
183 unsigned UseClass,
unsigned UseIdx)
const {
186 if ((FirstDefIdx + DefIdx) >= LastDefIdx)
188 if (Forwardings[FirstDefIdx + DefIdx] == 0)
193 if ((FirstUseIdx + UseIdx) >= LastUseIdx)
196 return Forwardings[FirstDefIdx + DefIdx] ==
197 Forwardings[FirstUseIdx + UseIdx];
204 unsigned UseClass,
unsigned UseIdx)
const {
208 int DefCycle = getOperandCycle(DefClass, DefIdx);
212 int UseCycle = getOperandCycle(UseClass, UseIdx);
216 UseCycle = DefCycle - UseCycle + 1;
218 hasPipelineForwarding(DefClass, DefIdx, UseClass, UseIdx))
235 #endif // LLVM_MC_MCINSTRITINERARIES_H GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
This class represents lattice values for constants.
const InstrStage * beginStage(unsigned ItinClassIndx) const
Return the first stage of the itinerary.
unsigned Units_
Choice of functional units.
unsigned getUnits() const
Returns the choice of FUs.
int NextCycles_
Number of machine cycles to next stage.
InstrItineraryData(const MCSchedModel &SM, const InstrStage *S, const unsigned *OS, const unsigned *F)
Itinerary data supplied by a subtarget to be used by a target.
int getNumMicroOps(unsigned ItinClassIndx) const
Return the number of micro-ops that the given class decodes to.
unsigned getStageLatency(unsigned ItinClassIndx) const
Return the total stage latency of the given class.
static const MCSchedModel & GetDefaultSchedModel()
Returns the default initialized model.
unsigned getNextCycles() const
Returns the number of cycles from the start of this stage to the start of the next stage in the itine...
ReservationKinds getReservationKind() const
int getOperandLatency(unsigned DefClass, unsigned DefIdx, unsigned UseClass, unsigned UseIdx) const
Compute and return the use operand latency of a given itinerary class and operand index if the value ...
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
int16_t NumMicroOps
of micro-ops, -1 means it's variable
ReservationKinds Kind_
Kind of the FU reservation.
unsigned Cycles_
Length of stage in machine cycles.
bool isEndMarker(unsigned ItinClassIndx) const
Returns true if the index is for the end marker itinerary.
unsigned getCycles() const
Returns the number of cycles the stage is occupied.
uint16_t LastOperandCycle
Index of last + 1 operand rd/wr.
uint16_t FirstStage
Index of first stage in itinerary.
bool isEmpty() const
Returns true if there are no itineraries.
These values represent a non-pipelined step in the execution of an instruction.
const InstrStage * endStage(unsigned ItinClassIndx) const
Return the last+1 stage of the itinerary.
bool hasPipelineForwarding(unsigned DefClass, unsigned DefIdx, unsigned UseClass, unsigned UseIdx) const
Return true if there is a pipeline forwarding between instructions of itinerary classes DefClass and ...
uint16_t LastStage
Index of last + 1 stage in itinerary.
uint16_t FirstOperandCycle
Index of first operand rd/wr.
An itinerary represents the scheduling information for an instruction.
int getOperandCycle(unsigned ItinClassIndx, unsigned OperandIdx) const
Return the cycle for the given class and operand.
Machine model for scheduling, bundling, and heuristics.