23 if (DomLevels.empty()) {
26 DomLevels[*DFI] = DFI.getPathLength() - 1;
32 typedef std::pair<DomTreeNode *, unsigned> DomTreeNodePair;
33 typedef std::priority_queue<DomTreeNodePair, SmallVector<DomTreeNodePair, 32>,
39 PQ.push(std::make_pair(Node, DomLevels.lookup(Node)));
47 DomTreeNodePair RootPair = PQ.top();
50 unsigned RootLevel = RootPair.second;
59 VisitedWorklist.
insert(Root);
61 while (!Worklist.
empty()) {
70 if (SuccNode->
getIDom() == Node)
73 unsigned SuccLevel = DomLevels.lookup(SuccNode);
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(SuccNode, SuccLevel));
89 for (
auto DomChild : *Node) {
90 if (VisitedWorklist.
insert(DomChild).second)
void push_back(const T &Elt)
Function object to check whether the second component of a std::pair compares less than the second co...
void calculate(SmallVectorImpl< BasicBlock * > &IDFBlocks)
Calculate iterated dominance frontiers.
T LLVM_ATTRIBUTE_UNUSED_RESULT pop_back_val()
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
DomTreeNodeBase< NodeT > * getRootNode()
getRootNode - This returns the entry node for the CFG of the function.
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const
Base class for the actual dominator tree node.
LLVM Basic Block Representation.
df_iterator< T > df_end(const T &G)
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
DomTreeNodeBase< NodeT > * getIDom() const
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
df_iterator< T > df_begin(const T &G)
void emplace_back(ArgTypes &&...Args)
succ_range successors(BasicBlock *BB)
DomTreeNodeBase< NodeT > * getNode(NodeT *BB) const
getNode - return the (Post)DominatorTree node for the specified basic block.