14 #ifndef LLVM_CODEGEN_SCHEDULEDFS_H 15 #define LLVM_CODEGEN_SCHEDULEDFS_H 42 InstrCount(count), Length(length) {}
46 return (uint64_t)InstrCount * RHS.
Length 53 return (uint64_t)InstrCount * RHS.
Length 69 static const unsigned InvalidSubtreeID = ~0u;
79 unsigned SubtreeID = InvalidSubtreeID;
86 unsigned ParentTreeID = InvalidSubtreeID;
87 unsigned SubInstrCount = 0;
97 Connection(
unsigned tree,
unsigned level): TreeID(tree), Level(level) {}
101 unsigned SubtreeLimit;
103 std::vector<NodeData> DFSNodeData;
110 std::vector<SmallVector<Connection, 4>> SubtreeConnections;
114 std::vector<unsigned> SubtreeConnectLevels;
118 : IsBottomUp(IsBU), SubtreeLimit(lim) {}
126 bool empty()
const {
return DFSNodeData.empty(); }
132 SubtreeConnections.clear();
133 SubtreeConnectLevels.clear();
138 DFSNodeData.resize(NumSUnits);
147 return DFSNodeData[SU->
NodeNum].InstrCount;
153 return DFSTreeData[SubtreeID].SubInstrCount;
174 return DFSNodeData[SU->
NodeNum].SubtreeID;
182 return SubtreeConnectLevels[SubtreeID];
187 void scheduleTree(
unsigned SubtreeID);
194 #endif // LLVM_CODEGEN_SCHEDULEDFS_H unsigned getNumInstrs(const SUnit *SU) const
Get the number of instructions in the given subtree and its children.
void clear()
Clear the results.
This class represents lattice values for constants.
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...
Represent the ILP of the subDAG rooted at a DAG node.
bool operator<(ILPValue RHS) const
unsigned getNumSubInstrs(unsigned SubtreeID) const
Get the number of instructions in the given subtree not including children.
Compute the values of each DAG node for various metrics during DFS.
void print(raw_ostream &OS) const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
unsigned getSubtreeID(const SUnit *SU) const
Get the ID of the subtree the given DAG node belongs to.
ILPValue(unsigned count, unsigned length)
unsigned getNumSubtrees() const
The number of subtrees detected in this DAG.
auto count(R &&Range, const E &Element) -> typename std::iterator_traits< decltype(adl_begin(Range))>::difference_type
Wrapper function around std::count to count the number of times an element Element occurs in the give...
void resize(unsigned NumSUnits)
Initialize the result data with the size of the DAG.
bool operator<=(ILPValue RHS) const
bool empty() const
Return true if this DFSResult is uninitialized.
Internal state used to compute SchedDFSResult.
constexpr bool empty(const T &RangeOrContainer)
Test whether RangeOrContainer is empty. Similar to C++17 std::empty.
unsigned Length
Length may either correspond to depth or height, depending on direction, and cycles or nodes dependin...
unsigned getSubtreeLevel(unsigned SubtreeID) const
Get the connection level of a subtree.
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
unsigned NodeNum
Entry # of node in the node vector.
bool operator>=(ILPValue RHS) const
SchedDFSResult(bool IsBU, unsigned lim)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This class implements an extremely fast bulk output stream that can only output to a stream...
bool operator>(ILPValue RHS) const
unsigned getSubtreeLimit() const
Get the node cutoff before subtrees are considered significant.
Scheduling unit. This is a node in the scheduling DAG.
ILPValue getILP(const SUnit *SU) const
Get the ILP value for a DAG node.