21 template <
class NodeTy,
bool IsPostDom>
28 typedef std::pair<DomTreeNode *, std::pair<unsigned, unsigned>>
30 typedef std::priority_queue<DomTreeNodePair, SmallVector<DomTreeNodePair, 32>,
34 DT.updateDFSNumbers();
38 PQ.push({Node, std::make_pair(Node->getLevel(), Node->getDFSNumIn())});
46 DomTreeNodePair RootPair = PQ.top();
49 unsigned RootLevel = RootPair.second.first;
58 VisitedWorklist.
insert(Root);
60 while (!Worklist.
empty()) {
70 if (SuccNode->
getIDom() == Node)
73 const unsigned SuccLevel = SuccNode->
getLevel();
74 if (SuccLevel > RootLevel)
77 if (!VisitedPQ.
insert(SuccNode).second)
81 if (useLiveIn && !LiveInBlocks->count(SuccBB))
85 if (!DefBlocks->count(SuccBB))
86 PQ.push(std::make_pair(
87 SuccNode, std::make_pair(SuccLevel, SuccNode->
getDFSNumIn())));
96 for (
auto *Succ : children<NodeTy>(BB))
100 for (
auto DomChild : *Node) {
101 if (VisitedWorklist.
insert(DomChild).second)
iterator_range< typename GraphTraits< GraphType >::ChildIteratorType > children(const typename GraphTraits< GraphType >::NodeRef &G)
This class represents lattice values for constants.
Function object to check whether the second component of a std::pair compares less than the second co...
void push_back(const T &Elt)
unsigned getDFSNumIn() const
getDFSNumIn/getDFSNumOut - These return the DFS visitation order for nodes in the dominator tree...
LLVM Basic Block Representation.
DomTreeNodeBase * getIDom() const
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
Compute iterated dominance frontiers using a linear time algorithm.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
void calculate(SmallVectorImpl< BasicBlock *> &IDFBlocks)
Calculate iterated dominance frontiers.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
LLVM_NODISCARD T pop_back_val()
This file provides various utilities for inspecting and working with the control flow graph in LLVM I...
void emplace_back(ArgTypes &&... Args)
LLVM_NODISCARD bool empty() const
Determine the iterated dominance frontier, given a set of defining blocks, and optionally, a set of live-in blocks.
unsigned getLevel() const