From fc20b67e80157635fa99b00e8d0cd63a9e57fdd5 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Sun, 27 Sep 2009 15:37:03 +0000 Subject: 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 --- llvm/lib/Transforms/Scalar/LoopRotation.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib') 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()) + 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. -- cgit v1.2.3