diff options
author | Dan Gohman <gohman@apple.com> | 2009-07-08 19:14:29 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-07-08 19:14:29 +0000 |
commit | 7bb3173ff7f4646f217a16b39ad7b407e516a99e (patch) | |
tree | 30e38efb22f0e69b3e6a904b5414ab5cde41af4a /llvm/lib/Transforms/Scalar/LoopDeletion.cpp | |
parent | c10c8d3e2ba225e14891b5c93bd79760a575da88 (diff) | |
download | bcm5719-llvm-7bb3173ff7f4646f217a16b39ad7b407e516a99e.tar.gz bcm5719-llvm-7bb3173ff7f4646f217a16b39ad7b407e516a99e.zip |
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.
llvm-svn: 75029
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopDeletion.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopDeletion.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopDeletion.cpp b/llvm/lib/Transforms/Scalar/LoopDeletion.cpp index 76a773a8081..38d0b39a082 100644 --- a/llvm/lib/Transforms/Scalar/LoopDeletion.cpp +++ b/llvm/lib/Transforms/Scalar/LoopDeletion.cpp @@ -199,7 +199,12 @@ bool LoopDeletion::runOnLoop(Loop* L, LPPassManager& LPM) { // 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 @@ 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 |