diff options
author | Dan Gohman <gohman@apple.com> | 2009-05-02 17:29:26 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-05-02 17:29:26 +0000 |
commit | c27345f0b4d9af879d249c9aca26e4f8d0aab0b5 (patch) | |
tree | c0acfa4cb4e205293bf31eee74b3101c323b6809 /llvm/lib/Transforms/Scalar/LoopDeletion.cpp | |
parent | 462cd343328c5498351184aa4b4d289580074ec2 (diff) | |
download | bcm5719-llvm-c27345f0b4d9af879d249c9aca26e4f8d0aab0b5.tar.gz bcm5719-llvm-c27345f0b4d9af879d249c9aca26e4f8d0aab0b5.zip |
Tell ScalarEvolution that the loop is being deleted before actually
deleting it. This will let ScalarEvolution be more complete about
updating its records.
llvm-svn: 70632
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopDeletion.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopDeletion.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopDeletion.cpp b/llvm/lib/Transforms/Scalar/LoopDeletion.cpp index d7be820e74f..83c25619bfc 100644 --- a/llvm/lib/Transforms/Scalar/LoopDeletion.cpp +++ b/llvm/lib/Transforms/Scalar/LoopDeletion.cpp @@ -258,6 +258,11 @@ bool LoopDeletion::runOnLoop(Loop* L, LPPassManager& LPM) { (*LI)->dropAllReferences(); } + // Tell ScalarEvolution that the loop is deleted. Do this before + // deleting the loop so that ScalarEvolution can look at the loop + // to determine what it needs to clean up. + SE.forgetLoopBackedgeTakenCount(L); + // Erase the instructions and the blocks without having to worry // about ordering because we already dropped the references. // NOTE: This iteration is safe because erasing the block does not remove its @@ -266,9 +271,6 @@ bool LoopDeletion::runOnLoop(Loop* L, LPPassManager& LPM) { LI != LE; ++LI) (*LI)->eraseFromParent(); - // Tell ScalarEvolution that the loop is deleted. - SE.forgetLoopBackedgeTakenCount(L); - // Finally, the blocks from loopinfo. This has to happen late because // otherwise our loop iterators won't work. LoopInfo& loopInfo = getAnalysis<LoopInfo>(); |