[llvm-commits] [llvm] r75029 - /llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp
Dan Gohman
gohman at apple.com
Wed Jul 8 12:15:11 PDT 2009
Author: djg
Date: Wed Jul 8 14:14:29 2009
New Revision: 75029
URL: http://llvm.org/viewvc/llvm-project?rev=75029&view=rev
Log:
Tell ScalarEvolution to forget a loop before starting to delete it.
This way ScalarEvolution can examine the loop to determine what state
it needs to update, if it chooses.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp?rev=75029&r1=75028&r2=75029&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp Wed Jul 8 14:14:29 2009
@@ -199,7 +199,12 @@
// Because we're deleting a large chunk of code at once, the sequence in which
// we remove things is very important to avoid invalidation issues. Don't
// mess with this unless you have good reason and know what you're doing.
-
+
+ // 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);
+
// Move simple loop-invariant expressions out of the loop, since they
// might be needed by the exit phis.
for (Loop::block_iterator LI = L->block_begin(), LE = L->block_end();
@@ -248,11 +253,6 @@
(*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
More information about the llvm-commits
mailing list