summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopRotation.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-09-27 15:37:03 +0000
committerDan Gohman <gohman@apple.com>2009-09-27 15:37:03 +0000
commitfc20b67e80157635fa99b00e8d0cd63a9e57fdd5 (patch)
treea1396d3821d07c61b9aa2177ba06d34d970562b8 /llvm/lib/Transforms/Scalar/LoopRotation.cpp
parent4338f905b79bf996bfa10ba515f915e2986bcccb (diff)
downloadbcm5719-llvm-fc20b67e80157635fa99b00e8d0cd63a9e57fdd5.tar.gz
bcm5719-llvm-fc20b67e80157635fa99b00e8d0cd63a9e57fdd5.zip
Tell ScalarEvolution to forget everything it knows about a loop before
rotating the loop, since loop rotation is a very significant change. llvm-svn: 82901
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopRotation.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopRotation.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopRotation.cpp b/llvm/lib/Transforms/Scalar/LoopRotation.cpp
index 34ba48c6b05..70c69bb1dae 100644
--- a/llvm/lib/Transforms/Scalar/LoopRotation.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopRotation.cpp
@@ -177,6 +177,11 @@ bool LoopRotate::rotateLoop(Loop *Lp, LPPassManager &LPM) {
// Now, this loop is suitable for rotation.
+ // Anything ScalarEvolution may know about this loop or the PHI nodes
+ // in its header will soon be invalidated.
+ if (ScalarEvolution *SE = getAnalysisIfAvailable<ScalarEvolution>())
+ SE->forgetLoopBackedgeTakenCount(L);
+
// Find new Loop header. NewHeader is a Header's one and only successor
// that is inside loop. Header's other successor is outside the
// loop. Otherwise loop is not suitable for rotation.
OpenPOWER on IntegriCloud