LLVM API Documentation

Public Types | Public Member Functions | Public Attributes
llvm::SUnit Class Reference

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

#include <ScheduleDAG.h>

Collaboration diagram for llvm::SUnit:
Collaboration graph
[legend]

List of all members.

Public Types

typedef SmallVectorImpl< SDep >
::iterator 
pred_iterator
typedef SmallVectorImpl< SDep >
::iterator 
succ_iterator
typedef SmallVectorImpl< SDep >
::const_iterator 
const_pred_iterator
typedef SmallVectorImpl< SDep >
::const_iterator 
const_succ_iterator

Public Member Functions

 SUnit (SDNode *node, unsigned nodenum)
 SUnit (MachineInstr *instr, unsigned nodenum)
 SUnit ()
 SUnit - Construct a placeholder SUnit.
bool isBoundaryNode () const
 Boundary nodes are placeholders for the boundary of the scheduling region.
void setNode (SDNode *N)
SDNodegetNode () const
bool isInstr () const
void setInstr (MachineInstr *MI)
MachineInstrgetInstr () const
bool addPred (const SDep &D, bool Required=true)
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.
bool isTopReady () const
bool isBottomReady () const
void biasCriticalPath ()
 Order this node's predecessor edges such that the critical path edge occurs first.
void dump (const ScheduleDAG *G) const
void dumpAll (const ScheduleDAG *G) const
void print (raw_ostream &O, const ScheduleDAG *G) const

Public Attributes

SUnitOrigNode
const MCSchedClassDescSchedClass
SmallVector< SDep, 4 > Preds
SmallVector< SDep, 4 > Succs
unsigned NodeNum
unsigned NodeQueueId
unsigned NumPreds
unsigned NumSuccs
unsigned NumPredsLeft
unsigned NumSuccsLeft
unsigned WeakPredsLeft
unsigned WeakSuccsLeft
unsigned short NumRegDefsLeft
unsigned short Latency
bool isVRegCycle: 1
bool isCall: 1
bool isCallOp: 1
bool isTwoAddress: 1
bool isCommutable: 1
bool hasPhysRegUses: 1
bool hasPhysRegDefs: 1
bool hasPhysRegClobbers: 1
bool isPending: 1
bool isAvailable: 1
bool isScheduled: 1
bool isScheduleHigh: 1
bool isScheduleLow: 1
bool isCloned: 1
bool isUnbuffered: 1
bool hasReservedResource: 1
Sched::Preference SchedulingPref
unsigned TopReadyCycle
unsigned BotReadyCycle
const TargetRegisterClassCopyDstRC
const TargetRegisterClassCopySrcRC

Detailed Description

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

Definition at line 255 of file ScheduleDAG.h.


Member Typedef Documentation

Definition at line 274 of file ScheduleDAG.h.

Definition at line 275 of file ScheduleDAG.h.

Definition at line 272 of file ScheduleDAG.h.

Definition at line 273 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 319 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 335 of file ScheduleDAG.h.

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

SUnit - Construct a placeholder SUnit.

Definition at line 350 of file ScheduleDAG.h.


Member Function Documentation

bool SUnit::addPred ( const SDep D,
bool  Required = true 
)

Order this node's predecessor edges such that the critical path edge occurs first.

Definition at line 298 of file ScheduleDAG.cpp.

References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SDep::Data, llvm::SmallVectorTemplateCommon< T, typename >::end(), I, MaxDepth, NumPreds, Preds, and std::swap().

Referenced by llvm::ScheduleDAGMI::findRootsAndBiasEdges().

void SUnit::dump ( const ScheduleDAG G) const
void SUnit::dumpAll ( const ScheduleDAG G) const
unsigned llvm::SUnit::getDepth ( ) const [inline]
unsigned llvm::SUnit::getHeight ( ) const [inline]
MachineInstr* llvm::SUnit::getInstr ( ) const [inline]

getInstr - Return the representative MachineInstr for this SUnit. This may be used during post-regalloc scheduling.

Definition at line 400 of file ScheduleDAG.h.

Referenced by addChainDependency(), llvm::ScheduleDAGInstrs::addPhysRegDataDeps(), llvm::ScheduleDAGInstrs::addPhysRegDeps(), llvm::ScheduleDAGInstrs::addVRegDefDeps(), llvm::ScheduleDAGInstrs::addVRegUseDeps(), adjustChainDeps(), biasPhysRegCopy(), llvm::CriticalAntiDepBreaker::BreakAntiDependencies(), llvm::AggressiveAntiDepBreaker::BreakAntiDependencies(), llvm::SchedBoundary::bumpNode(), llvm::SchedBoundary::checkHazard(), llvm::ScheduleDAGInstrs::dumpNode(), llvm::ARMHazardRecognizer::EmitInstruction(), llvm::PPCHazardRecognizer970::EmitInstruction(), llvm::ScheduleDAGInstrs::getGraphNodeLabel(), llvm::ARMHazardRecognizer::getHazardType(), llvm::PPCHazardRecognizer970::getHazardType(), llvm::ScheduleDAG::getInstrDesc(), llvm::ScheduleDAGInstrs::getSchedClass(), llvm::ScheduleDAGInstrs::initSUnits(), llvm::VLIWResourceModel::isResourceAvailable(), iterateChainSucc(), llvm::VLIWPacketizerList::PacketizeMIs(), llvm::GenericScheduler::pickNode(), llvm::PostGenericScheduler::pickNode(), llvm::R600SchedStrategy::releaseBottomNode(), llvm::ConvergingVLIWScheduler::releaseBottomNode(), llvm::SchedBoundary::releaseNode(), llvm::GenericScheduler::reschedulePhysRegCopies(), llvm::VLIWResourceModel::reserveResources(), llvm::R600SchedStrategy::schedNode(), llvm::ScheduleDAGMILive::scheduleMI(), llvm::GenericScheduler::tryCandidate(), llvm::ScheduleDAGMILive::updatePressureDiffs(), llvm::SchedDFSImpl::visitPostorderNode(), and llvm::SchedDFSImpl::visitPreorder().

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

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 assoicative data structure keyed on node ID.

Definition at line 371 of file ScheduleDAG.h.

References NodeNum.

Referenced by llvm::SchedDFSResult::compute(), and llvm::ScheduleDAGMI::findRootsAndBiasEdges().

bool llvm::SUnit::isInstr ( ) const [inline]

isInstr - Return true if this SUnit refers to a machine instruction as opposed to an SDNode.

Definition at line 389 of file ScheduleDAG.h.

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

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

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

Definition at line 452 of file ScheduleDAG.h.

References Preds, and llvm::SmallVectorTemplateCommon< T, typename >::size().

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

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

Definition at line 460 of file ScheduleDAG.h.

References llvm::SmallVectorTemplateCommon< T, typename >::size(), and Succs.

Referenced by iterateChainSucc().

bool llvm::SUnit::isTopReady ( ) const [inline]
void llvm::SUnit::print ( raw_ostream O,
const ScheduleDAG G 
) const
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.

Definition at line 133 of file ScheduleDAG.cpp.

References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SDep::Data, llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::SmallVectorImpl< T >::erase(), llvm::SDep::getKind(), llvm::SDep::getSUnit(), I, isScheduled, llvm::SDep::isWeak(), N, NumPreds, NumPredsLeft, NumSuccs, NumSuccsLeft, P, Preds, setDepthDirty(), llvm::SDep::setSUnit(), Succs, WeakPredsLeft, and WeakSuccsLeft.

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 178 of file ScheduleDAG.cpp.

References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorBase::empty(), llvm::SmallVectorTemplateCommon< T, typename >::end(), I, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), and Succs.

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

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 213 of file ScheduleDAG.cpp.

References getDepth(), and setDepthDirty().

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 194 of file ScheduleDAG.cpp.

References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorBase::empty(), llvm::SmallVectorTemplateCommon< T, typename >::end(), I, llvm::SmallVectorImpl< T >::pop_back_val(), Preds, and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().

Referenced by addPred(), and setHeightToAtLeast().

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 224 of file ScheduleDAG.cpp.

References getHeight(), and setHeightDirty().

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 393 of file ScheduleDAG.h.

References llvm::AArch64CC::MI.

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

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 375 of file ScheduleDAG.h.


Member Data Documentation

Definition at line 314 of file ScheduleDAG.h.

Definition at line 315 of file ScheduleDAG.h.

Definition at line 294 of file ScheduleDAG.h.

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

Definition at line 296 of file ScheduleDAG.h.

Definition at line 289 of file ScheduleDAG.h.

Referenced by BURRSort(), and llvm::ScheduleDAGSDNodes::Clone().

Definition at line 295 of file ScheduleDAG.h.

Definition at line 299 of file ScheduleDAG.h.

Referenced by checkSpecialNodes(), and llvm::ScheduleDAGSDNodes::Clone().

Definition at line 290 of file ScheduleDAG.h.

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

Definition at line 277 of file ScheduleDAG.h.

Referenced by addChainDependency(), llvm::ScheduleDAGTopologicalSort::AddPred(), BUCompareLatency(), llvm::ScheduleDAGInstrs::buildSchedGraph(), llvm::SchedBoundary::bumpNode(), BURRSort(), CalcNodeSethiUllmanNumber(), llvm::SchedBoundary::checkHazard(), llvm::ScheduleDAGMILive::computeCyclicCriticalPath(), dump(), llvm::PPCDispatchGroupSBHazardRecognizer::EmitInstruction(), llvm::SchedBoundary::findMaxLatency(), llvm::ScheduleDAGSDNodes::getGraphNodeLabel(), llvm::ScoreboardHazardRecognizer::getHazardType(), llvm::SchedDFSResult::getILP(), llvm::DOTGraphTraits< ScheduleDAGMI * >::getNodeLabel(), llvm::SchedDFSResult::getNumInstrs(), llvm::ScheduleDAGMILive::getPressureDiff(), llvm::SchedDFSResult::getSubtreeID(), hasVRegCycleUse(), llvm::ScheduleDAGTopologicalSort::InitDAGTopologicalSorting(), initVRegCycle(), isBoundaryNode(), llvm::ScheduleDAGTopologicalSort::IsReachable(), llvm::SchedDFSImpl::isVisited(), llvm::SchedDFSImpl::joinPredSubtree(), llvm::latency_sort::operator()(), llvm::resource_sort::operator()(), llvm::GenericScheduler::pickNode(), llvm::PostGenericScheduler::pickNode(), llvm::LatencyPriorityQueue::push(), llvm::ResourcePriorityQueue::push(), llvm::ResourcePriorityQueue::SUSchedulingCost(), llvm::GenericSchedulerBase::traceCandidate(), llvm::GenericScheduler::tryCandidate(), llvm::PostGenericScheduler::tryCandidate(), llvm::ScheduleDAGMILive::updatePressureDiffs(), llvm::SchedDFSImpl::visitPostorderEdge(), llvm::SchedDFSImpl::visitPostorderNode(), and llvm::SchedDFSImpl::visitPreorder().

Definition at line 266 of file ScheduleDAG.h.

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


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