[llvm-commits] [llvm] r71305 - /llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp

Evan Cheng evan.cheng at apple.com
Fri May 8 18:08:24 PDT 2009


Author: evancheng
Date: Fri May  8 20:08:24 2009
New Revision: 71305

URL: http://llvm.org/viewvc/llvm-project?rev=71305&view=rev
Log:
Factor out code that optimize loop terminating condition.

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

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

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Fri May  8 20:08:24 2009
@@ -164,8 +164,11 @@
     ICmpInst *ChangeCompareStride(Loop *L, ICmpInst *Cond,
                                   IVStrideUse* &CondUse,
                                   const SCEVHandle* &CondStride);
+
     void OptimizeIndvars(Loop *L);
 
+    void OptimizeLoopTermCond(Loop *L);
+
     /// OptimizeShadowIV - If IV is used in a int-to-float cast
     /// inside the loop then try to eliminate the cast opeation.
     void OptimizeShadowIV(Loop *L);
@@ -2378,6 +2381,12 @@
 
   OptimizeShadowIV(L);
 
+  OptimizeLoopTermCond(L);
+}
+
+/// OptimizeLoopTermCond - Change loop terminating condition to use the 
+/// postinc iv when possible.
+void LoopStrengthReduce::OptimizeLoopTermCond(Loop *L) {
   // Finally, get the terminating condition for the loop if possible.  If we
   // can, we want to change it to use a post-incremented version of its
   // induction variable, to allow coalescing the live ranges for the IV into





More information about the llvm-commits mailing list