LLVM 22.0.0git
llvm::InstrItineraryData Class Reference

Itinerary data supplied by a subtarget to be used by a target. More...

#include "llvm/MC/MCInstrItineraries.h"

Public Member Functions

 InstrItineraryData ()=default
 InstrItineraryData (const MCSchedModel &SM, const InstrStage *S, const unsigned *OS, const unsigned *F)
bool isEmpty () const
 Returns true if there are no itineraries.
bool isEndMarker (unsigned ItinClassIndx) const
 Returns true if the index is for the end marker itinerary.
const InstrStagebeginStage (unsigned ItinClassIndx) const
 Return the first stage of the itinerary.
const InstrStageendStage (unsigned ItinClassIndx) const
 Return the last+1 stage of the itinerary.
unsigned getStageLatency (unsigned ItinClassIndx) const
 Return the total stage latency of the given class.
std::optional< unsignedgetOperandCycle (unsigned ItinClassIndx, unsigned OperandIdx) const
 Return the cycle for the given class and operand.
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 UseClasses so that value produced by an instruction of itinerary class DefClass, operand index DefIdx can be bypassed when it's read by an instruction of itinerary class UseClass, operand index UseIdx.
std::optional< unsignedgetOperandLatency (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 is produced by an instruction of the specified itinerary class and def operand index.
int getNumMicroOps (unsigned ItinClassIndx) const
 Return the number of micro-ops that the given class decodes to.

Public Attributes

MCSchedModel SchedModel
 Basic machine properties.
const InstrStageStages = nullptr
 Array of stages selected.
const unsignedOperandCycles = nullptr
 Array of operand cycles selected.
const unsignedForwardings = nullptr
 Array of pipeline forwarding paths.
const InstrItineraryItineraries
 Array of itineraries selected.

Detailed Description

Itinerary data supplied by a subtarget to be used by a target.

Definition at line 110 of file MCInstrItineraries.h.

Constructor & Destructor Documentation

◆ InstrItineraryData() [1/2]

llvm::InstrItineraryData::InstrItineraryData ( )
default

◆ InstrItineraryData() [2/2]

llvm::InstrItineraryData::InstrItineraryData ( const MCSchedModel & SM,
const InstrStage * S,
const unsigned * OS,
const unsigned * F )
inline

Definition at line 121 of file MCInstrItineraries.h.

References F, Forwardings, Itineraries, OperandCycles, SchedModel, and Stages.

Member Function Documentation

◆ beginStage()

const InstrStage * llvm::InstrItineraryData::beginStage ( unsigned ItinClassIndx) const
inline

Return the first stage of the itinerary.

Definition at line 136 of file MCInstrItineraries.h.

References Itineraries, and Stages.

Referenced by llvm::MCSchedModel::getReciprocalThroughput(), and getStageLatency().

◆ endStage()

const InstrStage * llvm::InstrItineraryData::endStage ( unsigned ItinClassIndx) const
inline

Return the last+1 stage of the itinerary.

Definition at line 142 of file MCInstrItineraries.h.

References Itineraries, and Stages.

Referenced by llvm::MCSchedModel::getReciprocalThroughput(), and getStageLatency().

◆ getNumMicroOps()

int llvm::InstrItineraryData::getNumMicroOps ( unsigned ItinClassIndx) const
inline

Return the number of micro-ops that the given class decodes to.

Return -1 for classes that require dynamic lookup via TargetInstrInfo.

Definition at line 232 of file MCInstrItineraries.h.

References isEmpty(), and Itineraries.

Referenced by llvm::ARMBaseInstrInfo::getNumMicroOps(), and getNumMicroOpsSwiftLdSt().

◆ getOperandCycle()

std::optional< unsigned > llvm::InstrItineraryData::getOperandCycle ( unsigned ItinClassIndx,
unsigned OperandIdx ) const
inline

Return the cycle for the given class and operand.

Return std::nullopt if the information is not available for the operand.

Definition at line 168 of file MCInstrItineraries.h.

References isEmpty(), Itineraries, and OperandCycles.

Referenced by llvm::MCSchedModel::computeInstrLatency(), llvm::PPCInstrInfo::getInstrLatency(), llvm::ARMBaseInstrInfo::getOperandLatency(), getOperandLatency(), llvm::TargetInstrInfo::getOperandLatency(), and llvm::TargetInstrInfo::hasLowDefLatency().

◆ getOperandLatency()

std::optional< unsigned > llvm::InstrItineraryData::getOperandLatency ( unsigned DefClass,
unsigned DefIdx,
unsigned UseClass,
unsigned UseIdx ) const
inline

Compute and return the use operand latency of a given itinerary class and operand index if the value is produced by an instruction of the specified itinerary class and def operand index.

Return std::nullopt if the information is not available for the operand.

Definition at line 208 of file MCInstrItineraries.h.

References getOperandCycle(), hasPipelineForwarding(), and isEmpty().

Referenced by llvm::TargetInstrInfo::getOperandLatency(), and llvm::TargetInstrInfo::getOperandLatency().

◆ getStageLatency()

unsigned llvm::InstrItineraryData::getStageLatency ( unsigned ItinClassIndx) const
inline

Return the total stage latency of the given class.

The latency is the maximum completion time for any stage in the itinerary. If no stages exist, it defaults to one cycle.

Definition at line 150 of file MCInstrItineraries.h.

References beginStage(), E(), endStage(), isEmpty(), and llvm::Latency.

Referenced by llvm::TargetInstrInfo::getInstrLatency(), llvm::TargetInstrInfo::getInstrLatency(), and llvm::HexagonInstrInfo::getInstrTimingClassLatency().

◆ hasPipelineForwarding()

bool llvm::InstrItineraryData::hasPipelineForwarding ( unsigned DefClass,
unsigned DefIdx,
unsigned UseClass,
unsigned UseIdx ) const
inline

Return true if there is a pipeline forwarding between instructions of itinerary classes DefClass and UseClasses so that value produced by an instruction of itinerary class DefClass, operand index DefIdx can be bypassed when it's read by an instruction of itinerary class UseClass, operand index UseIdx.

Definition at line 186 of file MCInstrItineraries.h.

References Forwardings, and Itineraries.

Referenced by getOperandLatency().

◆ isEmpty()

◆ isEndMarker()

bool llvm::InstrItineraryData::isEndMarker ( unsigned ItinClassIndx) const
inline

Returns true if the index is for the end marker itinerary.

Definition at line 130 of file MCInstrItineraries.h.

References Itineraries.

Member Data Documentation

◆ Forwardings

const unsigned* llvm::InstrItineraryData::Forwardings = nullptr

Array of pipeline forwarding paths.

Definition at line 116 of file MCInstrItineraries.h.

Referenced by hasPipelineForwarding(), and InstrItineraryData().

◆ Itineraries

const InstrItinerary* llvm::InstrItineraryData::Itineraries
Initial value:
=
nullptr

Array of itineraries selected.

Definition at line 117 of file MCInstrItineraries.h.

Referenced by beginStage(), endStage(), getNumMicroOps(), llvm::TargetInstrInfo::getNumMicroOps(), getOperandCycle(), hasPipelineForwarding(), InstrItineraryData(), isEmpty(), and isEndMarker().

◆ OperandCycles

const unsigned* llvm::InstrItineraryData::OperandCycles = nullptr

Array of operand cycles selected.

Definition at line 115 of file MCInstrItineraries.h.

Referenced by getOperandCycle(), and InstrItineraryData().

◆ SchedModel

MCSchedModel llvm::InstrItineraryData::SchedModel
Initial value:
=
static LLVM_ABI const MCSchedModel Default
Returns the default initialized model.
Definition MCSchedule.h:424

Basic machine properties.

Definition at line 112 of file MCInstrItineraries.h.

Referenced by InstrItineraryData().

◆ Stages

const InstrStage* llvm::InstrItineraryData::Stages = nullptr

Array of stages selected.

Definition at line 114 of file MCInstrItineraries.h.

Referenced by beginStage(), endStage(), and InstrItineraryData().


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