LLVM 19.0.0git
Classes | Public Member Functions | Protected Member Functions | List of all members
llvm::SchedDFSImpl Class Reference

Internal state used to compute SchedDFSResult. More...

Public Member Functions

 SchedDFSImpl (SchedDFSResult &r)
 
bool isVisited (const SUnit *SU) const
 Returns true if this node been visited by the DFS traversal.
 
void visitPreorder (const SUnit *SU)
 Initializes this node's instruction count.
 
void visitPostorderNode (const SUnit *SU)
 Called once for each node after all predecessors are visited.
 
void visitPostorderEdge (const SDep &PredDep, const SUnit *Succ)
 Called once for each tree edge after calling visitPostOrderNode on the predecessor.
 
void visitCrossEdge (const SDep &PredDep, const SUnit *Succ)
 Adds a connection for cross edges.
 
void finalize ()
 Sets each node's subtree ID to the representative ID and record connections between trees.
 

Protected Member Functions

bool joinPredSubtree (const SDep &PredDep, const SUnit *Succ, bool CheckLimit=true)
 Joins the predecessor subtree with the successor that is its DFS parent.
 
void addConnection (unsigned FromTree, unsigned ToTree, unsigned Depth)
 Called by finalize() to record a connection between trees.
 

Detailed Description

Internal state used to compute SchedDFSResult.

Definition at line 1240 of file ScheduleDAGInstrs.cpp.

Constructor & Destructor Documentation

◆ SchedDFSImpl()

llvm::SchedDFSImpl::SchedDFSImpl ( SchedDFSResult r)
inline

Member Function Documentation

◆ addConnection()

void llvm::SchedDFSImpl::addConnection ( unsigned  FromTree,
unsigned  ToTree,
unsigned  Depth 
)
inlineprotected

Called by finalize() to record a connection between trees.

Definition at line 1405 of file ScheduleDAGInstrs.cpp.

References llvm::CallingConv::C, llvm::Depth, and llvm::SmallVectorTemplateBase< T, bool >::push_back().

◆ finalize()

void llvm::SchedDFSImpl::finalize ( )
inline

Sets each node's subtree ID to the representative ID and record connections between trees.

Definition at line 1341 of file ScheduleDAGInstrs.cpp.

References assert(), llvm::IntEqClasses::compress(), llvm::dbgs(), llvm::Depth, End, llvm::IntEqClasses::getNumClasses(), Idx, LLVM_DEBUG, and llvm::SparseSet< ValueT, KeyFunctorT, SparseT >::size().

Referenced by llvm::SchedDFSResult::compute().

◆ isVisited()

bool llvm::SchedDFSImpl::isVisited ( const SUnit SU) const
inline

Returns true if this node been visited by the DFS traversal.

During visitPostorderNode the Node's SubtreeID is assigned to the Node ID. Later, SubtreeID is updated but remains valid.

Definition at line 1271 of file ScheduleDAGInstrs.cpp.

References llvm::SUnit::NodeNum.

Referenced by llvm::SchedDFSResult::compute().

◆ joinPredSubtree()

bool llvm::SchedDFSImpl::joinPredSubtree ( const SDep PredDep,
const SUnit Succ,
bool  CheckLimit = true 
)
inlineprotected

Joins the predecessor subtree with the successor that is its DFS parent.

Applies some heuristics before joining.

Definition at line 1378 of file ScheduleDAGInstrs.cpp.

References assert(), llvm::SDep::Data, llvm::SDep::getKind(), llvm::SDep::getSUnit(), llvm::IntEqClasses::join(), llvm::SUnit::NodeNum, and llvm::SUnit::Succs.

◆ visitCrossEdge()

void llvm::SchedDFSImpl::visitCrossEdge ( const SDep PredDep,
const SUnit Succ 
)
inline

Adds a connection for cross edges.

Definition at line 1335 of file ScheduleDAGInstrs.cpp.

References llvm::SDep::getSUnit().

Referenced by llvm::SchedDFSResult::compute().

◆ visitPostorderEdge()

void llvm::SchedDFSImpl::visitPostorderEdge ( const SDep PredDep,
const SUnit Succ 
)
inline

Called once for each tree edge after calling visitPostOrderNode on the predecessor.

Increment the parent node's instruction count and preemptively join this subtree to its parent's if it is small enough.

Definition at line 1328 of file ScheduleDAGInstrs.cpp.

References llvm::SDep::getSUnit(), and llvm::SUnit::NodeNum.

Referenced by llvm::SchedDFSResult::compute().

◆ visitPostorderNode()

void llvm::SchedDFSImpl::visitPostorderNode ( const SUnit SU)
inline

Called once for each node after all predecessors are visited.

Revisit this node's predecessors and potentially join them now that we know the ILP of the other predecessors.

Definition at line 1286 of file ScheduleDAGInstrs.cpp.

References llvm::SparseSet< ValueT, KeyFunctorT, SparseT >::count(), llvm::SDep::Data, llvm::SparseSet< ValueT, KeyFunctorT, SparseT >::erase(), llvm::SUnit::getInstr(), llvm::SDep::getKind(), llvm::SDep::getSUnit(), InstrCount, llvm::MachineInstr::isTransient(), llvm::SUnit::NodeNum, and llvm::SUnit::Preds.

Referenced by llvm::SchedDFSResult::compute().

◆ visitPreorder()

void llvm::SchedDFSImpl::visitPreorder ( const SUnit SU)
inline

Initializes this node's instruction count.

We don't need to flag the node visited until visitPostorder because the DAG cannot have cycles.

Definition at line 1278 of file ScheduleDAGInstrs.cpp.

References llvm::SUnit::getInstr(), llvm::MachineInstr::isTransient(), and llvm::SUnit::NodeNum.

Referenced by llvm::SchedDFSResult::compute().


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