diff options
author | Owen Anderson <resistor@mac.com> | 2007-04-09 00:52:49 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2007-04-09 00:52:49 +0000 |
commit | 558fc740da62bb93ddfc85f353ab0665b566127f (patch) | |
tree | 1b830bce4a2d5f5dd85278f85ccc2b4bcf6918c0 /lib/Transforms/Utils/LoopSimplify.cpp | |
parent | d2eae62e93fc6e398263a952609b6ea60a204802 (diff) |
Cleanup some from my DomSet-removal changes. Add a new
isReachableFromEntry
test to ETForest to factor a common test out of code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35786 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/LoopSimplify.cpp')
-rw-r--r-- | lib/Transforms/Utils/LoopSimplify.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Transforms/Utils/LoopSimplify.cpp b/lib/Transforms/Utils/LoopSimplify.cpp index 5319d18b1c..ffdc91c37a 100644 --- a/lib/Transforms/Utils/LoopSimplify.cpp +++ b/lib/Transforms/Utils/LoopSimplify.cpp @@ -312,6 +312,8 @@ BasicBlock *LoopSimplify::SplitBlockPredecessors(BasicBlock *BB, // Can we eliminate this phi node now? if (Value *V = PN->hasConstantValue(true)) { Instruction *I = dyn_cast<Instruction>(V); + // If I is in NewBB, the ETForest call will fail, because NewBB isn't + // registered in ETForest yet. Handle this case explicitly. if (!I || (I->getParent() != NewBB && getAnalysis<ETForest>().dominates(I, PN))) { PN->replaceAllUsesWith(V); @@ -701,15 +703,13 @@ void LoopSimplify::UpdateDomInfoForRevectoredPreds(BasicBlock *NewBB, { BasicBlock *OnePred = PredBlocks[0]; unsigned i = 1, e = PredBlocks.size(); - for (i = 1; !ETF.dominates(&OnePred->getParent()->getEntryBlock(), OnePred); - ++i) { + for (i = 1; !ETF.isReachableFromEntry(OnePred); ++i) { assert(i != e && "Didn't find reachable pred?"); OnePred = PredBlocks[i]; } for (; i != e; ++i) - if (PredBlocks[i] != OnePred && - ETF.dominates(&PredBlocks[i]->getParent()->getEntryBlock(), OnePred)){ + if (PredBlocks[i] != OnePred && ETF.isReachableFromEntry(OnePred)){ NewBBDominatesNewBBSucc = false; break; } |