aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-05-02 17:29:26 +0000
committerDan Gohman <gohman@apple.com>2009-05-02 17:29:26 +0000
commit0981ea4cda6a0b70c70729826c82096235a4c1e8 (patch)
treedf01c72dbe243a4bfdffc021150099b35382d201 /lib/Transforms
parent3e5206d4aa51829b72fd7b2b42652a484cfb9316 (diff)
downloadexternal_llvm-0981ea4cda6a0b70c70729826c82096235a4c1e8.zip
external_llvm-0981ea4cda6a0b70c70729826c82096235a4c1e8.tar.gz
external_llvm-0981ea4cda6a0b70c70729826c82096235a4c1e8.tar.bz2
Tell ScalarEvolution that the loop is being deleted before actually
deleting it. This will let ScalarEvolution be more complete about updating its records. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70632 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/LoopDeletion.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/LoopDeletion.cpp b/lib/Transforms/Scalar/LoopDeletion.cpp
index d7be820..83c2561 100644
--- a/lib/Transforms/Scalar/LoopDeletion.cpp
+++ b/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>();