From ba43963e96c9eb28d4f6862e46c5d3fbdc1f3b96 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Sat, 7 Apr 2007 07:17:27 +0000 Subject: Completely purge DomSet. This is the (hopefully) final patch for PR1171. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35731 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/PostDominators.cpp | 67 ----------------------------------------- 1 file changed, 67 deletions(-) (limited to 'lib/Analysis/PostDominators.cpp') diff --git a/lib/Analysis/PostDominators.cpp b/lib/Analysis/PostDominators.cpp index d1fe9dd7f6..24399405fc 100644 --- a/lib/Analysis/PostDominators.cpp +++ b/lib/Analysis/PostDominators.cpp @@ -166,73 +166,6 @@ bool ImmediatePostDominators::runOnFunction(Function &F) { return false; } -//===----------------------------------------------------------------------===// -// PostDominatorSet Implementation -//===----------------------------------------------------------------------===// - -static RegisterPass -B("postdomset", "Post-Dominator Set Construction", true); - -// Postdominator set construction. This converts the specified function to only -// have a single exit node (return stmt), then calculates the post dominance -// sets for the function. -// -bool PostDominatorSet::runOnFunction(Function &F) { - // Scan the function looking for the root nodes of the post-dominance - // relationships. These blocks end with return and unwind instructions. - // While we are iterating over the function, we also initialize all of the - // domsets to empty. - Roots.clear(); - for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) - if (succ_begin(I) == succ_end(I)) - Roots.push_back(I); - - // If there are no exit nodes for the function, postdomsets are all empty. - // This can happen if the function just contains an infinite loop, for - // example. - ImmediatePostDominators &IPD = getAnalysis(); - Doms.clear(); // Reset from the last time we were run... - if (Roots.empty()) return false; - - // If we have more than one root, we insert an artificial "null" exit, which - // has "virtual edges" to each of the real exit nodes. - //if (Roots.size() > 1) - // Doms[0].insert(0); - - // Root nodes only dominate themselves. - for (unsigned i = 0, e = Roots.size(); i != e; ++i) - Doms[Roots[i]].insert(Roots[i]); - - // Loop over all of the blocks in the function, calculating dominator sets for - // each function. - for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) - if (BasicBlock *IPDom = IPD[I]) { // Get idom if block is reachable - DomSetType &DS = Doms[I]; - assert(DS.empty() && "PostDomset already filled in for this block?"); - DS.insert(I); // Blocks always dominate themselves - - // Insert all dominators into the set... - while (IPDom) { - // If we have already computed the dominator sets for our immediate post - // dominator, just use it instead of walking all the way up to the root. - DomSetType &IPDS = Doms[IPDom]; - if (!IPDS.empty()) { - DS.insert(IPDS.begin(), IPDS.end()); - break; - } else { - DS.insert(IPDom); - IPDom = IPD[IPDom]; - } - } - } else { - // Ensure that every basic block has at least an empty set of nodes. This - // is important for the case when there is unreachable blocks. - Doms[I]; - } - - return false; -} - //===----------------------------------------------------------------------===// // PostDominatorTree Implementation //===----------------------------------------------------------------------===// -- cgit v1.2.3-18-g5258