diff options
author | Owen Anderson <resistor@mac.com> | 2007-04-15 08:47:27 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2007-04-15 08:47:27 +0000 |
commit | 3dc6776b338f81e2d47daa42cc12c9f91053043d (patch) | |
tree | 810e120395e315d2c0e11e0da643422ab5e72f4b /lib/Transforms | |
parent | 2aabd0722d68ee53af9ad7140d1c0b853b6fe421 (diff) | |
download | llvm-3dc6776b338f81e2d47daa42cc12c9f91053043d.tar.gz llvm-3dc6776b338f81e2d47daa42cc12c9f91053043d.tar.bz2 llvm-3dc6776b338f81e2d47daa42cc12c9f91053043d.tar.xz |
Remove ImmediateDominator analysis. The same information can be obtained from DomTree. A lot of code for
constructing ImmediateDominator is now folded into DomTree construction.
This is part of the ongoing work for PR217.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36063 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/LoopStrengthReduce.cpp | 1 | ||||
-rw-r--r-- | lib/Transforms/Utils/BreakCriticalEdges.cpp | 24 | ||||
-rw-r--r-- | lib/Transforms/Utils/LoopSimplify.cpp | 26 |
3 files changed, 0 insertions, 51 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 332ddfa488..38cfd91fe1 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -154,7 +154,6 @@ namespace { AU.addPreservedID(LoopSimplifyID); AU.addPreserved<LoopInfo>(); AU.addPreserved<ETForest>(); - AU.addPreserved<ImmediateDominators>(); AU.addPreserved<DominanceFrontier>(); AU.addPreserved<DominatorTree>(); diff --git a/lib/Transforms/Utils/BreakCriticalEdges.cpp b/lib/Transforms/Utils/BreakCriticalEdges.cpp index 2f91e57590..2cf2ecd3e9 100644 --- a/lib/Transforms/Utils/BreakCriticalEdges.cpp +++ b/lib/Transforms/Utils/BreakCriticalEdges.cpp @@ -38,7 +38,6 @@ namespace { virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved<ETForest>(); - AU.addPreserved<ImmediateDominators>(); AU.addPreserved<DominatorTree>(); AU.addPreserved<DominanceFrontier>(); AU.addPreserved<LoopInfo>(); @@ -196,29 +195,6 @@ bool llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P, if (NewBBDominatesDestBB) EF->setImmediateDominator(DestBB, NewBB); } - - // Should we update ImmediateDominator information? - if (ImmediateDominators *ID = P->getAnalysisToUpdate<ImmediateDominators>()) { - // Only do this if TIBB is reachable. - if (ID->get(TIBB) || &TIBB->getParent()->getEntryBlock() == TIBB) { - // TIBB is the new immediate dominator for NewBB. - ID->addNewBlock(NewBB, TIBB); - - // If NewBBDominatesDestBB hasn't been computed yet, do so with ID. - if (!OtherPreds.empty()) { - while (!OtherPreds.empty() && NewBBDominatesDestBB) { - NewBBDominatesDestBB = ID->dominates(DestBB, OtherPreds.back()); - OtherPreds.pop_back(); - } - OtherPreds.clear(); - } - - // If NewBBDominatesDestBB, then NewBB dominates DestBB, otherwise it - // doesn't dominate anything. - if (NewBBDominatesDestBB) - ID->setImmediateDominator(DestBB, NewBB); - } - } // Should we update DominatorTree information? if (DominatorTree *DT = P->getAnalysisToUpdate<DominatorTree>()) { diff --git a/lib/Transforms/Utils/LoopSimplify.cpp b/lib/Transforms/Utils/LoopSimplify.cpp index 75991688b1..7d34b95cba 100644 --- a/lib/Transforms/Utils/LoopSimplify.cpp +++ b/lib/Transforms/Utils/LoopSimplify.cpp @@ -68,7 +68,6 @@ namespace { AU.addRequired<ETForest>(); AU.addPreserved<LoopInfo>(); - AU.addPreserved<ImmediateDominators>(); AU.addPreserved<ETForest>(); AU.addPreserved<DominatorTree>(); AU.addPreserved<DominanceFrontier>(); @@ -749,31 +748,6 @@ void LoopSimplify::UpdateDomInfoForRevectoredPreds(BasicBlock *NewBB, } BasicBlock *NewBBIDom = 0; - - // Update immediate dominator information if we have it. - if (ImmediateDominators *ID = getAnalysisToUpdate<ImmediateDominators>()) { - unsigned i = 0; - for (i = 0; i < PredBlocks.size(); ++i) - if (ETF.dominates(&PredBlocks[i]->getParent()->getEntryBlock(), PredBlocks[i])) { - NewBBIDom = PredBlocks[i]; - break; - } - assert(i != PredBlocks.size() && "No reachable preds?"); - for (i = i + 1; i < PredBlocks.size(); ++i) { - if (ETF.dominates(&PredBlocks[i]->getParent()->getEntryBlock(), PredBlocks[i])) - NewBBIDom = ETF.nearestCommonDominator(NewBBIDom, PredBlocks[i]); - } - assert(NewBBIDom && "No immediate dominator found??"); - - // Set the immediate dominator now... - ID->addNewBlock(NewBB, NewBBIDom); - - // If NewBB strictly dominates other blocks, we need to update their idom's - // now. The only block that need adjustment is the NewBBSucc block, whose - // idom should currently be set to PredBlocks[0]. - if (NewBBDominatesNewBBSucc) - ID->setImmediateDominator(NewBBSucc, NewBB); - } // Update DominatorTree information if it is active. if (DominatorTree *DT = getAnalysisToUpdate<DominatorTree>()) { |