diff options
author | Andrew Trick <atrick@apple.com> | 2011-08-03 18:32:11 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2011-08-03 18:32:11 +0000 |
commit | bf69d033821f82e3015ff14220189fa9e3910487 (patch) | |
tree | 092cf0060e8d9a933665e7b835265ac27bd4aa0c /llvm/lib/Transforms/Utils/LoopSimplify.cpp | |
parent | e5ffe78c13a6767059e916e2896aa56d5dd5e30b (diff) | |
download | bcm5719-llvm-bf69d033821f82e3015ff14220189fa9e3910487.tar.gz bcm5719-llvm-bf69d033821f82e3015ff14220189fa9e3910487.zip |
SCEV: Use AssertingVH to catch dangling BasicBlock* when passes forget
to notify SCEV of a change. Add forgetLoop in a couple of those places.
llvm-svn: 136797
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopSimplify.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopSimplify.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp index 9af338ec7f4..9b16c7cbe13 100644 --- a/llvm/lib/Transforms/Utils/LoopSimplify.cpp +++ b/llvm/lib/Transforms/Utils/LoopSimplify.cpp @@ -325,6 +325,14 @@ ReprocessLoop: DEBUG(dbgs() << "LoopSimplify: Eliminating exiting block " << ExitingBlock->getName() << "\n"); + // If any reachable control flow within this loop has changed, notify + // ScalarEvolution. Currently assume the parent loop doesn't change + // (spliting edges doesn't count). If blocks, CFG edges, or other values + // in the parent loop change, then we need call to forgetLoop() for the + // parent instead. + if (SE) + SE->forgetLoop(L); + assert(pred_begin(ExitingBlock) == pred_end(ExitingBlock)); Changed = true; LI->removeBlock(ExitingBlock); |