[llvm-commits] [llvm] r82901 - /llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp

Dan Gohman gohman at apple.com
Sun Sep 27 10:37:03 CDT 2009


Author: djg
Date: Sun Sep 27 10:37:03 2009
New Revision: 82901

URL: http://llvm.org/viewvc/llvm-project?rev=82901&view=rev
Log:
Tell ScalarEvolution to forget everything it knows about a loop before
rotating the loop, since loop rotation is a very significant change.

Modified:
    llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp?rev=82901&r1=82900&r2=82901&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp Sun Sep 27 10:37:03 2009
@@ -177,6 +177,11 @@
 
   // 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.





More information about the llvm-commits mailing list