[llvm-branch-commits] [llvm-branch] r70398 - in /llvm/branches/Apple/Dib: lib/Analysis/ScalarEvolution.cpp test/Transforms/LoopStrengthReduce/2009-04-28-no-reduce-mul.ll

Bill Wendling isanbard at gmail.com
Wed Apr 29 11:45:54 PDT 2009


Author: void
Date: Wed Apr 29 13:45:54 2009
New Revision: 70398

URL: http://llvm.org/viewvc/llvm-project?rev=70398&view=rev
Log:
--- Merging r70386 into '.':
A    test/Transforms/LoopStrengthReduce/2009-04-28-no-reduce-mul.ll
U    lib/Analysis/ScalarEvolution.cpp

Fix recent regression in gcc.dg/pr26719.c (6835035).

Added:
    llvm/branches/Apple/Dib/test/Transforms/LoopStrengthReduce/2009-04-28-no-reduce-mul.ll
      - copied unchanged from r70386, llvm/trunk/test/Transforms/LoopStrengthReduce/2009-04-28-no-reduce-mul.ll
Modified:
    llvm/branches/Apple/Dib/lib/Analysis/ScalarEvolution.cpp

Modified: llvm/branches/Apple/Dib/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Analysis/ScalarEvolution.cpp?rev=70398&r1=70397&r2=70398&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Analysis/ScalarEvolution.cpp Wed Apr 29 13:45:54 2009
@@ -812,11 +812,14 @@
         SCEVHandle Step = AR->getStepRecurrence(*this);
 
         // Check whether the backedge-taken count can be losslessly casted to
-        // the addrec's type. The count is always unsigned.
+        // the addrec's type. The count needs to be the same whether sign
+        // extended or zero extended.
         SCEVHandle CastedBECount =
           getTruncateOrZeroExtend(BECount, Start->getType());
         if (BECount ==
-            getTruncateOrZeroExtend(CastedBECount, BECount->getType())) {
+            getTruncateOrZeroExtend(CastedBECount, BECount->getType()) &&
+            BECount ==
+            getTruncateOrSignExtend(CastedBECount, BECount->getType())) {
           const Type *WideTy =
             IntegerType::get(getTypeSizeInBits(Start->getType()) * 2);
           SCEVHandle SMul =





More information about the llvm-branch-commits mailing list