19 "Dominance Frontier Construction",
true,
true)
30 : currentBB(B), parentBB(P), Node(N), parentNode(PN) {}
38 void DominanceFrontier::anchor() { }
46 std::vector<DFCalculateWorkObject> workList;
49 workList.push_back(DFCalculateWorkObject(BB, NULL, Node, NULL));
51 DFCalculateWorkObject *currentW = &workList.back();
52 assert (currentW &&
"Missing work object.");
57 const DomTreeNode *parentNode = currentW->parentNode;
58 assert (currentBB &&
"Invalid work object. Missing current Basic Block");
59 assert (currentNode &&
"Invalid work object. Missing current Node");
63 if (visited.
count(currentBB) == 0) {
70 if (DT[*SI]->getIDom() != currentNode)
78 bool visitChild =
false;
80 NE = currentNode->
end(); NI !=
NE; ++NI) {
83 if (visited.
count(childBB) == 0) {
84 workList.push_back(DFCalculateWorkObject(childBB, currentBB,
85 IDominee, currentNode));
99 DomSetType::const_iterator CDFI = S.begin(), CDFE = S.end();
101 for (; CDFI != CDFE; ++CDFI) {
103 parentSet.insert(*CDFI);
108 }
while (!workList.empty());
115 OS <<
" DomFrontier for BB ";
119 OS <<
" <<exit node>>";
122 const std::set<BasicBlock*> &BBs =
I->second;
124 for (std::set<BasicBlock*>::const_iterator
I = BBs.begin(), E = BBs.end();
130 OS <<
"<<exit node>>";
136 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
const DomSetType & calculate(const DominatorTree &DT, const DomTreeNode *Node)
virtual void print(raw_ostream &OS, const Module *=0) const
INITIALIZE_PASS_BEGIN(DominanceFrontier,"domfrontier","Dominance Frontier Construction", true, true) INITIALIZE_PASS_END(DominanceFrontier
The main container class for the LLVM Intermediate Representation.
DomSetMapType::const_iterator const_iterator
bool properlyDominates(const DomTreeNode *A, const DomTreeNode *B) const
void WriteAsOperand(raw_ostream &, const Value *, bool PrintTy=true, const Module *Context=0)
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
Interval::succ_iterator succ_begin(Interval *I)
bool count(PtrType Ptr) const
count - Return true if the specified pointer is in the set.
Dominance Frontier Construction
Interval::succ_iterator succ_end(Interval *I)
const DomTreeNode * parentNode
std::set< BasicBlock * > DomSetType
LLVM Basic Block Representation.
void dump() const
dump - Dump the dominance frontier to dbgs().
DFCalculateWorkObject(BasicBlock *B, BasicBlock *P, const DomTreeNode *N, const DomTreeNode *PN)
std::vector< DomTreeNodeBase< NodeT > * >::const_iterator const_iterator
raw_ostream & dbgs()
dbgs - Return a circular-buffered debug stream.