LLVM API Documentation

llvm::SUnit Class Reference

SUnit - Scheduling unit. This is a node in the scheduling DAG. More...

#include <ScheduleDAG.h>

Collaboration diagram for llvm::SUnit:
[legend]

List of all members.

Public Types

typedef SmallVector< SDep, 4 >
::iterator 
pred_iterator
typedef SmallVector< SDep, 4 >
::iterator 
succ_iterator
typedef SmallVector< SDep, 4 >
::const_iterator 
const_pred_iterator
typedef SmallVector< SDep, 4 >
::const_iterator 
const_succ_iterator

Public Member Functions

 SUnit (SDNode *node, unsigned nodenum)
 SUnit (MachineInstr *instr, unsigned nodenum)
 SUnit ()
 SUnit - Construct a placeholder SUnit.
void setNode (SDNode *N)
SDNode * getNode () const
void setInstr (MachineInstr *MI)
MachineInstr * getInstr () const
void addPred (const SDep &D)
void removePred (const SDep &D)
unsigned getDepth () const
unsigned getHeight () const
void setDepthToAtLeast (unsigned NewDepth)
void setHeightToAtLeast (unsigned NewHeight)
void setDepthDirty ()
void setHeightDirty ()
bool isPred (SUnit *N)
 isPred - Test if node N is a predecessor of this node.
bool isSucc (SUnit *N)
 isSucc - Test if node N is a successor of this node.
void dump (const ScheduleDAG *G) const
void dumpAll (const ScheduleDAG *G) const
void print (raw_ostream &O, const ScheduleDAG *G) const

Public Attributes

SUnit * OrigNode
SmallVector< SDep, 4 > Preds
SmallVector< SDep, 4 > Succs
unsigned NodeNum
unsigned NodeQueueId
unsigned short Latency
short NumPreds
short NumSuccs
short NumPredsLeft
short NumSuccsLeft
bool isTwoAddress: 1
bool isCommutable: 1
bool hasPhysRegDefs: 1
bool hasPhysRegClobbers: 1
bool isPending: 1
bool isAvailable: 1
bool isScheduled: 1
bool isScheduleHigh: 1
bool isCloned: 1
const TargetRegisterClass * CopyDstRC
const TargetRegisterClass * CopySrcRC


Detailed Description

SUnit - Scheduling unit. This is a node in the scheduling DAG.

Definition at line 225 of file ScheduleDAG.h.


Member Typedef Documentation

Definition at line 238 of file ScheduleDAG.h.

Definition at line 239 of file ScheduleDAG.h.

typedef SmallVector<SDep, 4>::const_iterator llvm::SUnit::const_pred_iterator

Definition at line 240 of file ScheduleDAG.h.

typedef SmallVector<SDep, 4>::const_iterator llvm::SUnit::const_succ_iterator

Definition at line 241 of file ScheduleDAG.h.


Constructor & Destructor Documentation

llvm::SUnit::SUnit ( SDNode *  node,
unsigned  nodenum 
) [inline]

SUnit - Construct an SUnit for pre-regalloc scheduling to represent an SDNode and any nodes flagged to it.

Definition at line 270 of file ScheduleDAG.h.

llvm::SUnit::SUnit ( MachineInstr *  instr,
unsigned  nodenum 
) [inline]

SUnit - Construct an SUnit for post-regalloc scheduling to represent a MachineInstr.

Definition at line 282 of file ScheduleDAG.h.

llvm::SUnit::SUnit (  )  [inline]

SUnit - Construct a placeholder SUnit.

Definition at line 293 of file ScheduleDAG.h.


Member Function Documentation

void llvm::SUnit::setNode ( SDNode *  N  )  [inline]

setNode - Assign the representative SDNode for this SUnit. This may be used during pre-regalloc scheduling.

Definition at line 305 of file ScheduleDAG.h.

SDNode* llvm::SUnit::getNode (  )  const [inline]

void llvm::SUnit::setInstr ( MachineInstr *  MI  )  [inline]

setInstr - Assign the instruction for the SUnit. This may be used during post-regalloc scheduling.

Definition at line 319 of file ScheduleDAG.h.

MachineInstr* llvm::SUnit::getInstr (  )  const [inline]

void SUnit::addPred ( const SDep &  D  ) 

addPred - This 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.

addPred - This 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.

Definition at line 71 of file ScheduleDAG.cpp.

References llvm::SDep::Data, E, llvm::SDep::getKind(), llvm::SDep::getLatency(), llvm::SDep::getSUnit(), isScheduled, NumPreds, NumPredsLeft, NumSuccs, NumSuccsLeft, Preds, setDepthDirty(), setHeightDirty(), llvm::SDep::setSUnit(), and Succs.

Referenced by llvm::ScheduleDAGInstrs::BuildSchedGraph().

void SUnit::removePred ( const SDep &  D  ) 

removePred - This 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.

removePred - This 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.

Definition at line 101 of file ScheduleDAG.cpp.

References llvm::SDep::Data, E, llvm::SDep::getKind(), llvm::SDep::getLatency(), llvm::SDep::getSUnit(), II, isScheduled, NumPreds, NumPredsLeft, NumSuccs, NumSuccsLeft, Preds, setDepthDirty(), setHeightDirty(), llvm::SDep::setSUnit(), and Succs.

unsigned llvm::SUnit::getDepth (  )  const [inline]

getDepth - Return the depth of this node, which is the length of the maximum path up to any node with has no predecessors.

Definition at line 343 of file ScheduleDAG.h.

Referenced by CriticalPathStep(), and setDepthToAtLeast().

unsigned llvm::SUnit::getHeight (  )  const [inline]

getHeight - Return the height of this node, which is the length of the maximum path down to any node with has no successors.

Definition at line 350 of file ScheduleDAG.h.

Referenced by setHeightToAtLeast(), and llvm::ScheduleDAG::VerifySchedule().

void SUnit::setDepthToAtLeast ( unsigned  NewDepth  ) 

setDepthToAtLeast - If NewDepth is greater than this node's depth value, set it to be the new depth value. This also recursively marks successor nodes dirty.

setDepthToAtLeast - Update this node's successors to reflect the fact that this node's depth just increased.

Definition at line 172 of file ScheduleDAG.cpp.

References getDepth(), and setDepthDirty().

void SUnit::setHeightToAtLeast ( unsigned  NewHeight  ) 

setDepthToAtLeast - If NewDepth is greater than this node's depth value, set it to be the new height value. This also recursively marks predecessor nodes dirty.

setHeightToAtLeast - Update this node's predecessors to reflect the fact that this node's height just increased.

Definition at line 183 of file ScheduleDAG.cpp.

References getHeight(), and setHeightDirty().

void SUnit::setDepthDirty (  ) 

setDepthDirty - Set a flag in this node to indicate that its stored Depth value will require recomputation the next time getDepth() is called.

Definition at line 137 of file ScheduleDAG.cpp.

References E, llvm::SmallVectorImpl< T >::empty(), isDepthCurrent, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorImpl< T >::push_back(), Succs, and WorkList.

Referenced by addPred(), removePred(), and setDepthToAtLeast().

void SUnit::setHeightDirty (  ) 

setHeightDirty - Set a flag in this node to indicate that its stored Height value will require recomputation the next time getHeight() is called.

Definition at line 153 of file ScheduleDAG.cpp.

References E, llvm::SmallVectorImpl< T >::empty(), isHeightCurrent, llvm::SmallVectorImpl< T >::pop_back_val(), Preds, llvm::SmallVectorImpl< T >::push_back(), and WorkList.

Referenced by addPred(), removePred(), and setHeightToAtLeast().

bool llvm::SUnit::isPred ( SUnit *  N  )  [inline]

isPred - Test if node N is a predecessor of this node.

Definition at line 376 of file ScheduleDAG.h.

References Preds.

bool llvm::SUnit::isSucc ( SUnit *  N  )  [inline]

isSucc - Test if node N is a successor of this node.

Definition at line 384 of file ScheduleDAG.h.

References Succs.

void SUnit::dump ( const ScheduleDAG *  G  )  const

SUnit - Scheduling unit. It's an wrapper around either a single SDNode or a group of nodes flagged together.

Definition at line 259 of file ScheduleDAG.cpp.

References llvm::ScheduleDAG::dumpNode(), llvm::errs(), and NodeNum.

Referenced by dumpAll().

void SUnit::dumpAll ( const ScheduleDAG *  G  )  const

void llvm::SUnit::print ( raw_ostream &  O,
const ScheduleDAG *  G 
) const


Member Data Documentation

Definition at line 244 of file ScheduleDAG.h.

Definition at line 246 of file ScheduleDAG.h.

Referenced by addPred(), removePred(), and llvm::ScheduleDAG::VerifySchedule().

Definition at line 247 of file ScheduleDAG.h.

Referenced by addPred(), removePred(), and llvm::ScheduleDAG::VerifySchedule().

Definition at line 248 of file ScheduleDAG.h.

Referenced by addPred(), dumpAll(), removePred(), and llvm::ScheduleDAG::VerifySchedule().

Definition at line 249 of file ScheduleDAG.h.

Referenced by addPred(), dumpAll(), removePred(), and llvm::ScheduleDAG::VerifySchedule().

Definition at line 250 of file ScheduleDAG.h.

Referenced by llvm::ScheduleDAGSDNodes::Clone().

Definition at line 251 of file ScheduleDAG.h.

Referenced by llvm::ScheduleDAGSDNodes::Clone().

Definition at line 252 of file ScheduleDAG.h.

Referenced by llvm::ScheduleDAGSDNodes::Clone().

Definition at line 253 of file ScheduleDAG.h.

Referenced by llvm::ScheduleDAGSDNodes::Clone().

Definition at line 254 of file ScheduleDAG.h.

Definition at line 255 of file ScheduleDAG.h.

Definition at line 257 of file ScheduleDAG.h.

Referenced by llvm::latency_sort::operator()().

Definition at line 265 of file ScheduleDAG.h.

Referenced by llvm::ScheduleDAG::EmitPhysRegCopy().

Definition at line 266 of file ScheduleDAG.h.

Referenced by llvm::ScheduleDAG::EmitPhysRegCopy().


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