From f35a1dbc7ac0046a494cb66945096101ef3fcac6 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Sun, 15 Apr 2007 08:47:27 +0000 Subject: 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. llvm-svn: 36063 --- llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp | 24 ---------------------- llvm/lib/Transforms/Utils/LoopSimplify.cpp | 26 ------------------------ 2 files changed, 50 deletions(-) (limited to 'llvm/lib/Transforms/Utils') diff --git a/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp b/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp index 2f91e575908..2cf2ecd3e96 100644 --- a/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp +++ b/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp @@ -38,7 +38,6 @@ namespace { virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved(); - AU.addPreserved(); AU.addPreserved(); AU.addPreserved(); AU.addPreserved(); @@ -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()) { - // 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()) { diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp index 75991688b10..7d34b95cba5 100644 --- a/llvm/lib/Transforms/Utils/LoopSimplify.cpp +++ b/llvm/lib/Transforms/Utils/LoopSimplify.cpp @@ -68,7 +68,6 @@ namespace { AU.addRequired(); AU.addPreserved(); - AU.addPreserved(); AU.addPreserved(); AU.addPreserved(); AU.addPreserved(); @@ -749,31 +748,6 @@ void LoopSimplify::UpdateDomInfoForRevectoredPreds(BasicBlock *NewBB, } BasicBlock *NewBBIDom = 0; - - // Update immediate dominator information if we have it. - if (ImmediateDominators *ID = getAnalysisToUpdate()) { - 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()) { -- cgit v1.2.3