13#ifndef LLVM_CODEGEN_SCHEDULEDFS_H
14#define LLVM_CODEGEN_SCHEDULEDFS_H
68 static const unsigned InvalidSubtreeID = ~0u;
77 unsigned InstrCount = 0;
78 unsigned SubtreeID = InvalidSubtreeID;
85 unsigned ParentTreeID = InvalidSubtreeID;
86 unsigned SubInstrCount = 0;
96 Connection(
unsigned tree,
unsigned level): TreeID(tree), Level(level) {}
100 unsigned SubtreeLimit;
102 std::vector<NodeData> DFSNodeData;
105 SmallVector<TreeData, 16> DFSTreeData;
109 std::vector<SmallVector<Connection, 4>> SubtreeConnections;
113 std::vector<unsigned> SubtreeConnectLevels;
117 : IsBottomUp(IsBU), SubtreeLimit(lim) {}
125 bool empty()
const {
return DFSNodeData.empty(); }
131 SubtreeConnections.clear();
132 SubtreeConnectLevels.clear();
137 DFSNodeData.resize(NumSUnits);
146 return DFSNodeData[SU->
NodeNum].InstrCount;
152 return DFSTreeData[SubtreeID].SubInstrCount;
173 return DFSNodeData[SU->
NodeNum].SubtreeID;
181 return SubtreeConnectLevels[SubtreeID];
189raw_ostream &
operator<<(raw_ostream &
OS,
const ILPValue &Val);
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallVector class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Scheduling unit. This is a node in the scheduling DAG.
unsigned NodeNum
Entry # of node in the node vector.
unsigned getDepth() const
Returns the depth of this node, which is the length of the maximum path up to any node which has no p...
Internal state used to compute SchedDFSResult.
Compute the values of each DAG node for various metrics during DFS.
unsigned getNumSubInstrs(unsigned SubtreeID) const
Get the number of instructions in the given subtree not including children.
unsigned getNumInstrs(const SUnit *SU) const
Get the number of instructions in the given subtree and its children.
unsigned getSubtreeID(const SUnit *SU) const
Get the ID of the subtree the given DAG node belongs to.
SchedDFSResult(bool IsBU, unsigned lim)
void clear()
Clear the results.
unsigned getSubtreeLimit() const
Get the node cutoff before subtrees are considered significant.
ILPValue getILP(const SUnit *SU) const
Get the ILP value for a DAG node.
bool empty() const
Return true if this DFSResult is uninitialized.
void compute(ArrayRef< SUnit > SUnits)
Compute various metrics for the DAG with given roots.
unsigned getNumSubtrees() const
The number of subtrees detected in this DAG.
unsigned getSubtreeLevel(unsigned SubtreeID) const
Get the connection level of a subtree.
void resize(unsigned NumSUnits)
Initialize the result data with the size of the DAG.
void scheduleTree(unsigned SubtreeID)
Scheduler callback to update SubtreeConnectLevels when a tree is initially scheduled.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
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...
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
ArrayRef(const T &OneElt) -> ArrayRef< T >
Represent the ILP of the subDAG rooted at a DAG node.
bool operator<(ILPValue RHS) const
unsigned Length
Length may either correspond to depth or height, depending on direction, and cycles or nodes dependin...
bool operator<=(ILPValue RHS) const
bool operator>=(ILPValue RHS) const
ILPValue(unsigned count, unsigned length)
void print(raw_ostream &OS) const
bool operator>(ILPValue RHS) const