[llvm-commits] [llvm] r55680 - in /llvm/trunk: lib/Transforms/Scalar/LoopStrengthReduce.cpp test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll

Devang Patel dpatel at apple.com
Tue Sep 2 17:10:56 PDT 2008


Author: dpatel
Date: Tue Sep  2 19:10:56 2008
New Revision: 55680

URL: http://llvm.org/viewvc/llvm-project?rev=55680&view=rev
Log:
Check iteration count.

Modified:
    llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
    llvm/trunk/test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll

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

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue Sep  2 19:10:56 2008
@@ -1908,6 +1908,10 @@
 /// change the type of IV, if possible.
 void LoopStrengthReduce::OptimizeIVType(Loop *L) {
 
+  SCEVHandle IterationCount = SE->getIterationCount(L);
+  if (isa<SCEVCouldNotCompute>(IterationCount))
+    return;
+
   BasicBlock *LPH = L->getLoopPreheader();
   BasicBlock *LatchBB = L->getLoopLatch();
   SmallVector<PHINode *, 4> PHIs;

Modified: llvm/trunk/test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll?rev=55680&r1=55679&r2=55680&view=diff

==============================================================================
--- llvm/trunk/test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll (original)
+++ llvm/trunk/test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll Tue Sep  2 19:10:56 2008
@@ -49,7 +49,7 @@
 	store i16* %theDCTBufferIter.0.lcssa, i16** %tmp6, align 4
 	%tmp37 = add i16 %component.09, 1		; <i16> [#uses=2]
 	%phitmp15 = sext i16 %tmp37 to i32		; <i32> [#uses=1]
-	%tmp46 = icmp slt i32 %phitmp15, %tmp4412		; <i1> [#uses=1]
+	%tmp46 = icmp slt i32 %phitmp15, 42		; <i1> [#uses=1]
 	br i1 %tmp46, label %bb, label %bb49
 
 bb49:		; preds = %bb28, %entry





More information about the llvm-commits mailing list