29#include "llvm/Config/llvm-config.h"
38#define DEBUG_TYPE "pre-RA-sched"
40STATISTIC(LoadsClustered,
"Number of loads clustered together");
47 cl::desc(
"Roughly estimate the number of cycles that 'long latency'"
48 "instructions take for targets with no itinerary"));
51 :
ScheduleDAG(mf), InstrItins(mf.getSubtarget().getInstrItineraryData()) {}
77 "SUnits std::vector reallocated on the fly!");
82 (
N->isMachineOpcode() &&
83 N->getMachineOpcode() == TargetOpcode::IMPLICIT_DEF))
115 unsigned &PhysReg,
int &
Cost) {
119 unsigned Reg = cast<RegisterSDNode>(
User->
getOperand(1))->getReg();
128 cast<RegisterSDNode>(Def->getOperand(1))->getReg() == Reg) {
130 }
else if (Def->isMachineOpcode()) {
132 if (ResNo >=
II.getNumDefs() &&
II.hasImplicitDefOfPhysReg(Reg))
138 TRI->getMinimalPhysRegClass(Reg, Def->getSimpleValueType(ResNo));
147 if (ExtraOper.getNode())
169 if (GlueDestNode ==
N)
return false;
173 N->getOperand(
N->getNumOperands()-1).getValueType() == MVT::Glue) {
177 if (
N->getValueType(
N->getNumValues() - 1) == MVT::Glue)
return false;
191 assert((
N->getValueType(
N->getNumValues() - 1) == MVT::Glue &&
192 !
N->hasAnyUseOfValue(
N->getNumValues() - 1)) &&
193 "expected an unused glue value");
196 ArrayRef(
N->value_begin(),
N->getNumValues() - 1));
204void ScheduleDAGSDNodes::ClusterNeighboringLoads(
SDNode *
Node) {
206 unsigned NumOps =
Node->getNumOperands();
207 if (
Node->getOperand(NumOps-1).getValueType() == MVT::Other)
208 Chain =
Node->getOperand(NumOps-1);
215 auto hasTiedInput = [
this](
const SDNode *
N) {
230 bool Cluster =
false;
233 if (hasTiedInput(
Base))
238 unsigned UseCount = 0;
240 I != E && UseCount < 100; ++
I, ++UseCount) {
241 if (
I.getUse().getResNo() != Chain.
getResNo())
247 int64_t Offset1, Offset2;
249 Offset1 == Offset2 ||
250 hasTiedInput(
User)) {
255 if (O2SMap.
insert(std::make_pair(Offset1,
Base)).second)
259 if (Offset2 < Offset1)
274 unsigned NumLoads = 0;
276 SDNode *BaseLoad = O2SMap[BaseOff];
278 for (
unsigned i = 1, e =
Offsets.size(); i != e; ++i) {
296 for (
unsigned I = 1, E = Loads.
size();
I != E; ++
I) {
297 bool OutGlue =
I < E - 1;
308 else if (!OutGlue && InGlue.
getNode())
315void ScheduleDAGSDNodes::ClusterNodes() {
318 if (!
Node || !
Node->isMachineOpcode())
321 unsigned Opc =
Node->getMachineOpcode();
325 ClusterNeighboringLoads(
Node);
329void ScheduleDAGSDNodes::BuildSchedUnits() {
333 unsigned NumNodes = 0;
344 SUnits.reserve(NumNodes * 2);
353 while (!Worklist.
empty()) {
358 if (Visited.
insert(
Op.getNode()).second)
375 while (
N->getNumOperands() &&
376 N->getOperand(
N->getNumOperands()-1).getValueType() == MVT::Glue) {
377 N =
N->getOperand(
N->getNumOperands()-1).getNode();
378 assert(
N->getNodeId() == -1 &&
"Node already inserted!");
380 if (
N->isMachineOpcode() &&
TII->
get(
N->getMachineOpcode()).
isCall())
386 while (
N->getValueType(
N->getNumValues()-1) == MVT::Glue) {
390 bool HasGlueUse =
false;
392 if (GlueVal.isOperandOf(U)) {
394 assert(
N->getNodeId() == -1 &&
"Node already inserted!");
397 if (
N->isMachineOpcode() &&
TII->
get(
N->getMachineOpcode()).
isCall())
401 if (!HasGlueUse)
break;
417 assert(
N->getNodeId() == -1 &&
"Node already inserted!");
428 while (!CallSUnits.
empty()) {
442void ScheduleDAGSDNodes::AddSchedEdges() {
467 if (
N->isMachineOpcode() &&
471 while (NumUsed != 0 && !
N->hasAnyUseOfValue(NumUsed - 1))
477 for (
unsigned i = 0, e =
N->getNumOperands(); i != e; ++i) {
478 SDNode *OpN =
N->getOperand(i).getNode();
479 unsigned DefIdx =
N->getOperand(i).getResNo();
482 assert(OpSU &&
"Node has no SUnit!");
486 EVT OpVT =
N->getOperand(i).getValueType();
487 assert(OpVT != MVT::Glue &&
"Glued nodes should be in same sunit!");
488 bool isChain = OpVT == MVT::Other;
490 unsigned PhysReg = 0;
495 assert((PhysReg == 0 || !isChain) &&
496 "Chain dependence via physreg data?");
506 unsigned OpLatency = isChain ? 1 : OpSU->
Latency;
514 if (!isChain && !UnitLatencies) {
516 ST.adjustSchedDependency(OpSU, DefIdx, &SU, i, Dep,
nullptr);
549void ScheduleDAGSDNodes::RegDefIter::InitNodeNumDefs() {
554 if (!Node->isMachineOpcode()) {
561 unsigned POpc =
Node->getMachineOpcode();
562 if (POpc == TargetOpcode::IMPLICIT_DEF) {
567 if (POpc == TargetOpcode::PATCHPOINT &&
568 Node->getValueType(0) == MVT::Other) {
578 NodeNumDefs = std::min(
Node->getNumValues(), NRegDefs);
585 : SchedDAG(SD), Node(SU->
getNode()) {
593 for (;DefIdx < NodeNumDefs; ++DefIdx) {
594 if (!Node->hasAnyUseOfValue(DefIdx))
596 ValueType = Node->getSimpleValueType(DefIdx);
600 Node = Node->getGluedNode();
634 if (
N &&
N->isMachineOpcode() &&
646 if (
N->isMachineOpcode())
651 unsigned OpIdx,
SDep& dep)
const{
659 unsigned DefIdx =
Use->getOperand(OpIdx).getResNo();
660 if (
Use->isMachineOpcode())
663 std::optional<unsigned>
Latency =
667 unsigned Reg = cast<RegisterSDNode>(
Use->getOperand(1))->getReg();
679#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
684 dbgs() <<
"PHYS REG COPY\n";
693 while (!GluedNodes.
empty()) {
703#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
713#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
719 dbgs() <<
"**** NOOP ****\n";
732 "The number of nodes scheduled doesn't match the expected number!");
741 if (!
N->getHasDebugValue())
746 auto HasUnknownVReg = [&VRBaseMap](
SDDbgValue *DV) {
749 VRBaseMap.
count({L.getSDNode(), L.getResNo()}) == 0)
762 unsigned DVOrder = DV->getOrder();
763 if (Order != 0 && DVOrder != Order)
770 if (!DV->isInvalidated() && HasUnknownVReg(DV))
775 Orders.push_back({DVOrder, DbgMI});
788 unsigned Order =
N->getIROrder();
789 if (!Order || Seen.
count(Order)) {
802 Orders.push_back({Order, NewInsn});
810void ScheduleDAGSDNodes::
820 assert(VRI != VRBaseMap.
end() &&
"Node emitted out of order - late");
837 bool isNew = VRBaseMap.
insert(std::make_pair(SU, VRBase)).second;
839 assert(isNew &&
"Node emitted out of order - early");
863 [&](
SDNode *Node,
bool IsClone,
bool IsCloned,
870 return std::prev(
Emitter.getInsertPos());
874 Emitter.EmitNode(Node, IsClone, IsCloned, VRBaseMap);
891 if (
MI->isCandidateForCallSiteEntry() &&
901 MI->setPCSections(
MF, MD);
908 It->setMMRAMetadata(
MF, MMRA);
918 for (; PDI != PDE; ++PDI) {
924 (*PDI)->clearIsEmitted();
940 EmitPhysRegCopy(SU, CopyVRBaseMap, InsertPos);
947 while (!GluedNodes.
empty()) {
955 if (NewInsn && NewInsn->isCall())
956 NewInsn->setHeapAllocMarker(
MF, MD);
968 if (NewInsn && NewInsn->isCall())
969 NewInsn->setHeapAllocMarker(
MF, MD);
984 return LHS->getOrder() < RHS->getOrder();
990 unsigned LastOrder = 0;
991 for (
unsigned i = 0, e = Orders.
size(); i != e && DI != DE; ++i) {
992 unsigned Order = Orders[i].first;
996 for (; DI != DE; ++DI) {
997 if ((*DI)->getOrder() < LastOrder || (*DI)->getOrder() >= Order)
999 if ((*DI)->isEmitted())
1011 MI->getParent()->insert(Pos, DbgMI);
1020 for (; DI != DE; ++DI) {
1021 if ((*DI)->isEmitted())
1023 assert((*DI)->getOrder() >= LastOrder &&
1024 "emitting DBG_VALUE out of order");
1037 for (
const auto &InstrOrder : Orders) {
1038 unsigned Order = InstrOrder.first;
1044 for (; DLI != DLE &&
1045 (*DLI)->getOrder() >= LastOrder && (*DLI)->getOrder() < Order;
1056 MI->getParent()->insert(Pos, DbgMI);
1067 InsertPos =
Emitter.getInsertPos();
1073 if (FirstTerm != InsertBB->
end()) {
1074 assert(!FirstTerm->isDebugValue() &&
1075 "first terminator cannot be a debug value");
1079 if (&
MI == InsertPos)
1082 if (!
MI.isDebugValue())
1087 MI.getOperand(0).ChangeToRegister(0,
false);
1088 MI.moveBefore(&*FirstTerm);
static msgpack::DocNode getNode(msgpack::DocNode DN, msgpack::Type Type, MCValue Val)
dxil DXContainer Global Emitter
This file defines the DenseMap class.
const HexagonInstrInfo * TII
unsigned const TargetRegisterInfo * TRI
This file provides utility for Memory Model Relaxation Annotations (MMRAs).
uint64_t IntrinsicInst * II
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static void ProcessSDDbgValues(SDNode *N, SelectionDAG *DAG, InstrEmitter &Emitter, SmallVectorImpl< std::pair< unsigned, MachineInstr * > > &Orders, DenseMap< SDValue, Register > &VRBaseMap, unsigned Order)
ProcessSDDbgValues - Process SDDbgValues associated with this node.
static bool AddGlue(SDNode *N, SDValue Glue, bool AddGlue, SelectionDAG *DAG)
static void RemoveUnusedGlue(SDNode *N, SelectionDAG *DAG)
static void CheckForPhysRegDependency(SDNode *Def, SDNode *User, unsigned Op, const TargetRegisterInfo *TRI, const TargetInstrInfo *TII, const TargetLowering &TLI, unsigned &PhysReg, int &Cost)
CheckForPhysRegDependency - Check if the dependency between def and use of a specified operand is a p...
static void ProcessSourceNode(SDNode *N, SelectionDAG *DAG, InstrEmitter &Emitter, DenseMap< SDValue, Register > &VRBaseMap, SmallVectorImpl< std::pair< unsigned, MachineInstr * > > &Orders, SmallSet< Register, 8 > &Seen, MachineInstr *NewInsn)
static cl::opt< int > HighLatencyCycles("sched-high-latency-cycles", cl::Hidden, cl::init(10), cl::desc("Roughly estimate the number of cycles that 'long latency'" "instructions take for targets with no itinerary"))
static void CloneNodeWithValues(SDNode *N, SelectionDAG *DAG, ArrayRef< EVT > VTs, SDValue ExtraOper=SDValue())
This file defines the SmallPtrSet class.
This file defines the SmallSet class.
This file defines the SmallVector class.
This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...
#define STATISTIC(VARNAME, DESC)
This file describes how to lower LLVM code to machine code.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
This class represents an Operation in the Expression.
iterator find(const_arg_type_t< KeyT > Val)
size_type count(const_arg_type_t< KeyT > Val) const
Return 1 if the specified key is in the map, 0 otherwise.
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
static unsigned CountResults(SDNode *Node)
CountResults - The results of target nodes have register or immediate operands first,...
bool isEmpty() const
Returns true if there are no itineraries.
Describe properties that are true of each instruction in the target description file.
unsigned getNumOperands() const
Return the number of declared MachineOperands for this MachineInstruction.
bool mayLoad() const
Return true if this instruction could possibly read memory.
unsigned getNumDefs() const
Return the number of MachineOperands that are register definitions.
int getOperandConstraint(unsigned OpNum, MCOI::OperandConstraint Constraint) const
Returns the value of the specified operand constraint if it is present.
ArrayRef< MCPhysReg > implicit_defs() const
Return a list of registers that are potentially written by any instance of this machine instruction.
bool isCommutable() const
Return true if this may be a 2- or 3-address instruction (of the form "X = op Y, Z,...
bool isCall() const
Return true if the instruction is a call.
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode.
instr_iterator insert(instr_iterator I, MachineInstr *M)
Insert MI into the instruction list before I, possibly inside a bundle.
iterator getFirstTerminator()
Returns an iterator to the first terminator instruction of this basic block.
iterator getFirstNonPHI()
Returns a pointer to the first instruction in this block that is not a PHINode instruction.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
std::string getFullName() const
Return a formatted string to identify this block and its parent function.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
void addCallSiteInfo(const MachineInstr *CallI, CallSiteInfo &&CallInfo)
Start tracking the arguments passed to the call CallI.
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
Representation of each machine instruction.
Register createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
An SDNode that represents everything that will be needed to construct a MachineInstr.
mmo_iterator memoperands_begin() const
mmo_iterator memoperands_end() const
Wrapper class representing virtual and physical registers.
static constexpr bool isVirtualRegister(unsigned Reg)
Return true if the specified register number is in the virtual register namespace.
SmallVectorImpl< SDDbgLabel * >::iterator DbgLabelIterator
SmallVectorImpl< SDDbgValue * >::iterator DbgIterator
Holds the information for a single machine location through SDISel; either an SDNode,...
@ SDNODE
Value is the result of an expression.
Holds the information from a dbg_value node through SDISel.
This class provides iterator support for SDUse operands that use a specific SDNode.
Represents one node in the SelectionDAG.
bool isMachineOpcode() const
Test if this node has a post-isel opcode, directly corresponding to a MachineInstr opcode.
int getNodeId() const
Return the unique node id.
void dump() const
Dump this node, for debugging.
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
iterator_range< value_op_iterator > op_values() const
unsigned getNumValues() const
Return the number of values defined/returned by this operator.
unsigned getMachineOpcode() const
This may only be called if isMachineOpcode returns true.
const SDValue & getOperand(unsigned Num) const
use_iterator use_begin() const
Provide iteration support to walk over all uses of an SDNode.
SDNode * getGluedNode() const
If this node has a glue operand, return the node to which the glue operand points.
static use_iterator use_end()
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.
SDNode * getNode() const
get the SDNode which holds the desired result
unsigned getResNo() const
get the index which selects a specific result in the SDNode
Kind getKind() const
Returns an enum value representing the kind of the dependence.
@ Data
Regular data dependence (aka true-dependence).
void setLatency(unsigned Lat)
Sets the latency for this edge.
@ Barrier
An unknown scheduling barrier.
bool isCtrl() const
Shorthand for getKind() != SDep::Data.
unsigned getReg() const
Returns the register associated with this edge.
Scheduling unit. This is a node in the scheduling DAG.
bool isCloned
True if this node has been cloned.
bool isCall
Is a function call.
void setNode(SDNode *N)
Assigns the representative SDNode for this SUnit.
unsigned NodeNum
Entry # of node in the node vector.
bool hasPhysRegClobbers
Has any physreg defs, used or not.
bool isCallOp
Is a function call operand.
const TargetRegisterClass * CopyDstRC
Is a special copy node if != nullptr.
unsigned short Latency
Node latency.
unsigned short NumRegDefsLeft
bool isScheduleHigh
True if preferable to schedule high.
bool isScheduleLow
True if preferable to schedule low.
bool hasPhysRegDefs
Has physreg defs that are being used.
SmallVector< SDep, 4 > Succs
All sunit successors.
Sched::Preference SchedulingPref
Scheduling preference.
SDNode * getNode() const
Returns the representative SDNode for this SUnit.
bool isTwoAddress
Is a two-address instruction.
bool isCommutable
Is a commutable instruction.
bool isVRegCycle
May use and def the same vreg.
SmallVector< SDep, 4 > Preds
All sunit predecessors.
SUnit * OrigNode
If not this, the node from which this node was cloned.
bool addPred(const SDep &D, bool Required=true)
Adds the specified edge as a pred of the current node if not already.
RegDefIter - In place iteration over the values defined by an SUnit.
RegDefIter(const SUnit *SU, const ScheduleDAGSDNodes *SD)
ScheduleDAGSDNodes - A ScheduleDAG for scheduling SDNode-based DAGs.
SUnit * newSUnit(SDNode *N)
NewSUnit - Creates a new SUnit and return a ptr to it.
void VerifyScheduledSequence(bool isBottomUp)
VerifyScheduledSequence - Verify that all SUnits are scheduled and consistent with the Sequence of sc...
virtual void Schedule()=0
Schedule - Order nodes according to selected style, filling in the Sequence member.
virtual void computeLatency(SUnit *SU)
computeLatency - Compute node latency.
std::string getDAGName() const override
Return the basic block label.
virtual MachineBasicBlock * EmitSchedule(MachineBasicBlock::iterator &InsertPos)
EmitSchedule - Insert MachineInstrs into the MachineBasicBlock according to the order specified in Se...
virtual bool forceUnitLatencies() const
ForceUnitLatencies - Return true if all scheduling edges should be given a latency value of one.
void BuildSchedGraph(AAResults *AA)
BuildSchedGraph - Build the SUnit graph from the selection dag that we are input.
static bool isPassiveNode(SDNode *Node)
isPassiveNode - Return true if the node is a non-scheduled leaf.
const InstrItineraryData * InstrItins
void InitNumRegDefsLeft(SUnit *SU)
InitNumRegDefsLeft - Determine the # of regs defined by this node.
std::vector< SUnit * > Sequence
The schedule. Null SUnit*'s represent noop instructions.
void Run(SelectionDAG *dag, MachineBasicBlock *bb)
Run - perform scheduling.
void dump() const override
void dumpNode(const SUnit &SU) const override
SUnit * Clone(SUnit *Old)
Clone - Creates a clone of the specified SUnit.
ScheduleDAGSDNodes(MachineFunction &mf)
void dumpSchedule() const
virtual void computeOperandLatency(SDNode *Def, SDNode *Use, unsigned OpIdx, SDep &dep) const
MachineRegisterInfo & MRI
Virtual/real register map.
void clearDAG()
Clears the DAG state (between regions).
const TargetInstrInfo * TII
Target instruction information.
std::vector< SUnit > SUnits
The scheduling units.
const TargetRegisterInfo * TRI
Target processor register info.
SUnit EntrySU
Special node for the region entry.
MachineFunction & MF
Machine function.
void dumpNodeAll(const SUnit &SU) const
unsigned VerifyScheduledDAG(bool isBottomUp)
Verifies that all SUnits were scheduled and that their state is consistent.
void dumpNodeName(const SUnit &SU) const
SUnit ExitSU
Special node for the region exit.
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
const SDValue & getRoot() const
Return the root tag of the SelectionDAG.
SDVTList getVTList(EVT VT)
Return an SDVTList that represents the list of values specified.
SDDbgInfo::DbgIterator ByvalParmDbgEnd() const
SDDbgInfo::DbgIterator ByvalParmDbgBegin() const
const TargetLowering & getTargetLoweringInfo() const
MDNode * getHeapAllocSite(const SDNode *Node) const
Return HeapAllocSite associated with Node, or nullptr if none exists.
SDNode * MorphNodeTo(SDNode *N, unsigned Opc, SDVTList VTs, ArrayRef< SDValue > Ops)
This mutates the specified node to have the specified return type, opcode, and operands.
MDNode * getMMRAMetadata(const SDNode *Node) const
Return the MMRA MDNode associated with Node, or nullptr if none exists.
SDDbgInfo::DbgIterator DbgEnd() const
void setNodeMemRefs(MachineSDNode *N, ArrayRef< MachineMemOperand * > NewMemRefs)
Mutate the specified machine node's memory references to the provided list.
CallSiteInfo getCallSiteInfo(const SDNode *Node)
Return CallSiteInfo associated with Node, or a default if none exists.
MDNode * getPCSections(const SDNode *Node) const
Return PCSections associated with Node, or nullptr if none exists.
bool hasDebugValues() const
Return true if there are any SDDbgValue nodes associated with this SelectionDAG.
SDDbgInfo::DbgLabelIterator DbgLabelEnd() const
SDDbgInfo::DbgLabelIterator DbgLabelBegin() const
const TargetMachine & getTarget() const
bool getNoMergeSiteInfo(const SDNode *Node) const
Return NoMerge info associated with Node.
SDDbgInfo::DbgIterator DbgBegin() const
iterator_range< allnodes_iterator > allnodes()
ArrayRef< SDDbgValue * > GetDbgValues(const SDNode *SD) const
Get the debug values which reference the given SDNode.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
size_type count(const T &V) const
count - Return 1 if the element is in the set, 0 otherwise.
std::pair< const_iterator, bool > insert(const T &V)
insert - Insert an element into the set if it isn't already there.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void assign(size_type NumElts, ValueParamT Elt)
void push_back(const T &Elt)
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.
virtual void insertNoop(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const
Insert a noop into the instruction stream at the specified point.
virtual bool shouldScheduleLoadsNear(SDNode *Load1, SDNode *Load2, int64_t Offset1, int64_t Offset2, unsigned NumLoads) const
This is a used by the pre-regalloc scheduler to determine (in conjunction with areLoadsFromSameBasePt...
virtual std::optional< unsigned > getOperandLatency(const InstrItineraryData *ItinData, SDNode *DefNode, unsigned DefIdx, SDNode *UseNode, unsigned UseIdx) const
virtual unsigned getInstrLatency(const InstrItineraryData *ItinData, const MachineInstr &MI, unsigned *PredCost=nullptr) const
Compute the instruction latency of a given instruction.
virtual bool isHighLatencyDef(int opc) const
Return true if this opcode has high latency to its result.
virtual bool areLoadsFromSameBasePtr(SDNode *Load1, SDNode *Load2, int64_t &Offset1, int64_t &Offset2) const
This is used by the pre-regalloc scheduler to determine if two loads are loading from the same base a...
Sched::Preference getSchedulingPreference() const
Return target scheduling preference.
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
virtual bool checkForPhysRegDependency(SDNode *Def, SDNode *User, unsigned Op, const TargetRegisterInfo *TRI, const TargetInstrInfo *TII, unsigned &PhysReg, int &Cost) const
Allows the target to handle physreg-carried dependency in target-specific way.
unsigned EmitCallSiteInfo
The flag enables call site info production.
int getCopyCost() const
Return the cost of copying a value between two registers in this class.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
TargetSubtargetInfo - Generic base class for all target subtargets.
A Use represents the edge between a Value definition and its users.
Value * getOperand(unsigned i) const
@ CopyFromReg
CopyFromReg - This node indicates that the input value is a virtual or physical register that is defi...
@ CopyToReg
CopyToReg - This node has three operands: a chain, a register number to set to this value,...
@ TokenFactor
TokenFactor - This node takes multiple tokens as input and produces a single token result.
Reg
All possible values of the reg field in the ModR/M byte.
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
void stable_sort(R &&Range)
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
iterator_range< early_inc_iterator_impl< detail::IterOfRange< RangeT > > > make_early_inc_range(RangeT &&Range)
Make a range that does early increment to allow mutation of the underlying range without disrupting i...
void sort(IteratorTy Start, IteratorTy End)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
auto count(R &&Range, const E &Element)
Wrapper function around std::count to count the number of times an element Element occurs in the give...
This represents a list of ValueType's that has been intern'd by a SelectionDAG.
Function object to check whether the first component of a container supported by std::get (like std::...