[llvm-commits] [llvm] r123225 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp

Eric Christopher echristo at apple.com
Tue Jan 11 01:02:09 PST 2011


Author: echristo
Date: Tue Jan 11 03:02:09 2011
New Revision: 123225

URL: http://llvm.org/viewvc/llvm-project?rev=123225&view=rev
Log:
Temporarily revert 123133, it's causing some regressions and I'm trying
to get a testcase.

Modified:
    llvm/trunk/lib/Analysis/ScalarEvolution.cpp

Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=123225&r1=123224&r2=123225&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Tue Jan 11 03:02:09 2011
@@ -1560,14 +1560,10 @@
       AddRecOps[0] = getAddExpr(LIOps);
 
       // Build the new addrec. Propagate the NUW and NSW flags if both the
-      // outer add and the inner addrec are guaranteed to have no overflow or if
-      // there is no outer part.
-      if (Ops.size() != 1) {
-        HasNUW &= AddRec->hasNoUnsignedWrap();
-        HasNSW &= AddRec->hasNoSignedWrap();
-      }
-      
-      const SCEV *NewRec = getAddRecExpr(AddRecOps, AddRecLoop, HasNUW, HasNSW);
+      // outer add and the inner addrec are guaranteed to have no overflow.
+      const SCEV *NewRec = getAddRecExpr(AddRecOps, AddRecLoop,
+                                         HasNUW && AddRec->hasNoUnsignedWrap(),
+                                         HasNSW && AddRec->hasNoSignedWrap());
 
       // If all of the other operands were loop invariant, we are done.
       if (Ops.size() == 1) return NewRec;





More information about the llvm-commits mailing list