class SUnit
Declaration
class SUnit { /* full declaration omitted */ };
Description
Scheduling unit. This is a node in the scheduling DAG.
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:242
Member Variables
- public llvm::SUnit* OrigNode = nullptr
- If not this, the node from which this node
- public const llvm::MCSchedClassDesc* SchedClass = nullptr
- was cloned. (SD scheduling only)
- public SmallVector<llvm::SDep, 4> Preds
- All sunit predecessors.
- public SmallVector<llvm::SDep, 4> Succs
- All sunit successors.
- public unsigned int NodeNum = BoundaryID
- Entry # of node in the node vector.
- public unsigned int NodeQueueId = 0
- Queue id of node.
- public unsigned int NumPreds = 0
- # of SDep::Data preds.
- public unsigned int NumSuccs = 0
- # of SDep::Data sucss.
- public unsigned int NumPredsLeft = 0
- # of preds not scheduled.
- public unsigned int NumSuccsLeft = 0
- # of succs not scheduled.
- public unsigned int WeakPredsLeft = 0
- # of weak preds not scheduled.
- public unsigned int WeakSuccsLeft = 0
- # of weak succs not scheduled.
- public unsigned short NumRegDefsLeft = 0
- # of reg defs with no scheduled use.
- public unsigned short Latency = 0
- Node latency.
- public bool isVRegCycle
- May use and def the same vreg.
- public bool isCall
- Is a function call.
- public bool isCallOp
- Is a function call operand.
- public bool isTwoAddress
- Is a two-address instruction.
- public bool isCommutable
- Is a commutable instruction.
- public bool hasPhysRegUses
- Has physreg uses.
- public bool hasPhysRegDefs
- Has physreg defs that are being used.
- public bool hasPhysRegClobbers
- Has any physreg defs, used or not.
- public bool isPending
- True once pending.
- public bool isAvailable
- True once available.
- public bool isScheduled
- True once scheduled.
- public bool isScheduleHigh
- True if preferable to schedule high.
- public bool isScheduleLow
- True if preferable to schedule low.
- public bool isCloned
- True if this node has been cloned.
- public bool isUnbuffered
- Uses an unbuffered resource.
- public bool hasReservedResource
- Uses a reserved resource.
- public Sched::Preference SchedulingPref = Sched::None
- Scheduling preference.
- public unsigned int TopReadyCycle = 0
- Cycle relative to start when node is ready.
- public unsigned int BotReadyCycle = 0
- Cycle relative to end when node is ready.
- public const llvm::TargetRegisterClass* CopyDstRC = nullptr
- public const llvm::TargetRegisterClass* CopySrcRC = nullptr
Method Overview
- public SUnit(llvm::MachineInstr * instr, unsigned int nodenum)
- public SUnit()
- public SUnit(llvm::SDNode * node, unsigned int nodenum)
- public bool addPred(const llvm::SDep & D, bool Required = true)
- public bool addPredBarrier(llvm::SUnit * SU)
- public void biasCriticalPath()
- public void dumpAttributes() const
- public unsigned int getDepth() const
- public unsigned int getHeight() const
- public llvm::MachineInstr * getInstr() const
- public llvm::SDNode * getNode() const
- public bool isBottomReady() const
- public bool isBoundaryNode() const
- public bool isInstr() const
- public bool isPred(const llvm::SUnit * N) const
- public bool isSucc(const llvm::SUnit * N) const
- public bool isTopReady() const
- public void removePred(const llvm::SDep & D)
- public void setDepthDirty()
- public void setDepthToAtLeast(unsigned int NewDepth)
- public void setHeightDirty()
- public void setHeightToAtLeast(unsigned int NewHeight)
- public void setInstr(llvm::MachineInstr * MI)
- public void setNode(llvm::SDNode * N)
Methods
¶SUnit(llvm::MachineInstr* instr,
unsigned int nodenum)
SUnit(llvm::MachineInstr* instr,
unsigned int nodenum)
Description
Constructs an SUnit for post-regalloc scheduling to represent a MachineInstr.
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:319
Parameters
- llvm::MachineInstr* instr
- unsigned int nodenum
¶SUnit()
SUnit()
Description
Constructs a placeholder SUnit.
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:329
¶SUnit(llvm::SDNode* node, unsigned int nodenum)
SUnit(llvm::SDNode* node, unsigned int nodenum)
Description
Constructs an SUnit for pre-regalloc scheduling to represent an SDNode and any nodes flagged to it.
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:308
Parameters
- llvm::SDNode* node
- unsigned int nodenum
¶bool addPred(const llvm::SDep& D,
bool Required = true)
bool addPred(const llvm::SDep& D,
bool Required = true)
Description
Adds the specified edge as a pred of the current node if not already. It also adds the current node as a successor of the specified node.
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:380
Parameters
- const llvm::SDep& D
- bool Required = true
¶bool addPredBarrier(llvm::SUnit* SU)
bool addPredBarrier(llvm::SUnit* SU)
Description
Adds a barrier edge to SU by calling addPred(), with latency 0 generally or latency 1 for a store followed by a load.
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:384
Parameters
- llvm::SUnit* SU
¶void biasCriticalPath()
void biasCriticalPath()
Description
Orders this node's predecessor edges such that the critical path edge occurs first.
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:455
¶void dumpAttributes() const
void dumpAttributes() const
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:457
¶unsigned int getDepth() const
unsigned int getDepth() const
Description
Returns the depth of this node, which is the length of the maximum path up to any node which has no predecessors.
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:398
¶unsigned int getHeight() const
unsigned int getHeight() const
Description
Returns the height of this node, which is the length of the maximum path down to any node which has no successors.
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:406
¶llvm::MachineInstr* getInstr() const
llvm::MachineInstr* getInstr() const
Description
Returns the representative MachineInstr for this SUnit. This may be used during post-regalloc scheduling.
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:373
¶llvm::SDNode* getNode() const
llvm::SDNode* getNode() const
Description
Returns the representative SDNode for this SUnit. This may be used during pre-regalloc scheduling.
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:355
¶bool isBottomReady() const
bool isBottomReady() const
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:449
¶bool isBoundaryNode() const
bool isBoundaryNode() const
Description
Boundary nodes are placeholders for the boundary of the scheduling region. BoundaryNodes can have DAG edges, including Data edges, but they do not correspond to schedulable entities (e.g. instructions) and do not have a valid ID. Consequently, always check for boundary nodes before accessing an associative data structure keyed on node ID.
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:344
¶bool isInstr() const
bool isInstr() const
Description
Returns true if this SUnit refers to a machine instruction as opposed to an SDNode.
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:362
¶bool isPred(const llvm::SUnit* N) const
bool isPred(const llvm::SUnit* N) const
Description
Tests if node N is a predecessor of this node.
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:431
Parameters
- const llvm::SUnit* N
¶bool isSucc(const llvm::SUnit* N) const
bool isSucc(const llvm::SUnit* N) const
Description
Tests if node N is a successor of this node.
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:439
Parameters
- const llvm::SUnit* N
¶bool isTopReady() const
bool isTopReady() const
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:446
¶void removePred(const llvm::SDep& D)
void removePred(const llvm::SDep& D)
Description
Removes the specified edge as a pred of the current node if it exists. It also removes the current node as a successor of the specified node.
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:394
Parameters
- const llvm::SDep& D
¶void setDepthDirty()
void setDepthDirty()
Description
Sets a flag in this node to indicate that its stored Depth value will require recomputation the next time getDepth() is called.
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:424
¶void setDepthToAtLeast(unsigned int NewDepth)
void setDepthToAtLeast(unsigned int NewDepth)
Description
If NewDepth is greater than this node's depth value, sets it to be the new depth value. This also recursively marks successor nodes dirty.
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:415
Parameters
- unsigned int NewDepth
¶void setHeightDirty()
void setHeightDirty()
Description
Sets a flag in this node to indicate that its stored Height value will require recomputation the next time getHeight() is called.
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:428
¶void setHeightToAtLeast(unsigned int NewHeight)
void setHeightToAtLeast(unsigned int NewHeight)
Description
If NewHeight is greater than this node's height value, set it to be the new height value. This also recursively marks predecessor nodes dirty.
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:420
Parameters
- unsigned int NewHeight
¶void setInstr(llvm::MachineInstr* MI)
void setInstr(llvm::MachineInstr* MI)
Description
Assigns the instruction for the SUnit. This may be used during post-regalloc scheduling.
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:366
Parameters
¶void setNode(llvm::SDNode* N)
void setNode(llvm::SDNode* N)
Description
Assigns the representative SDNode for this SUnit. This may be used during pre-regalloc scheduling.
Declared at: llvm/include/llvm/CodeGen/ScheduleDAG.h:348
Parameters
- llvm::SDNode* N