aboutsummaryrefslogtreecommitdiffstats
path: root/lib
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
commite6fe67b2fb48b1f0f3c1ac8c1ce01e67c1f0bb1d (patch)
tree4c32e5dc25d2c8e8ce5aca318f5c046757cab3f3 /lib
parent6afea253e078357f7c306fa2b13151bbe24ae049 (diff)
downloadexternal_llvm-e6fe67b2fb48b1f0f3c1ac8c1ce01e67c1f0bb1d.zip
external_llvm-e6fe67b2fb48b1f0f3c1ac8c1ce01e67c1f0bb1d.tar.gz
external_llvm-e6fe67b2fb48b1f0f3c1ac8c1ce01e67c1f0bb1d.tar.bz2
Tell ScalarEvolution to forget everything it knows about a loop before
rotating the loop, since loop rotation is a very significant change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82901 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/LoopRotation.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/LoopRotation.cpp b/lib/Transforms/Scalar/LoopRotation.cpp
index 34ba48c..70c69bb 100644
--- a/lib/Transforms/Scalar/LoopRotation.cpp
+++ b/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.