[llvm-commits] [llvm] r154910 - in /llvm/trunk: lib/Analysis/ScalarEvolution.cpp test/Analysis/ScalarEvolution/nsw-offset.ll test/Analysis/ScalarEvolution/nsw.ll
Benjamin Kramer
benny.kra at googlemail.com
Mon Apr 16 23:33:57 PDT 2012
Author: d0k
Date: Tue Apr 17 01:33:57 2012
New Revision: 154910
URL: http://llvm.org/viewvc/llvm-project?rev=154910&view=rev
Log:
Revert "SCEV: When expanding a GEP the final addition to the base pointer has NUW but not NSW."
This isn't right either, reverting for now.
Modified:
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
llvm/trunk/test/Analysis/ScalarEvolution/nsw-offset.ll
llvm/trunk/test/Analysis/ScalarEvolution/nsw.ll
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=154910&r1=154909&r2=154910&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Tue Apr 17 01:33:57 2012
@@ -3187,7 +3187,7 @@
// Add the total offset from all the GEP indices to the base.
return getAddExpr(BaseS, TotalOffset,
- isInBounds ? SCEV::FlagNUW : SCEV::FlagAnyWrap);
+ isInBounds ? SCEV::FlagNSW : SCEV::FlagAnyWrap);
}
/// GetMinTrailingZeros - Determine the minimum number of zero bits that S is
Modified: llvm/trunk/test/Analysis/ScalarEvolution/nsw-offset.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/nsw-offset.ll?rev=154910&r1=154909&r2=154910&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/ScalarEvolution/nsw-offset.ll (original)
+++ llvm/trunk/test/Analysis/ScalarEvolution/nsw-offset.ll Tue Apr 17 01:33:57 2012
@@ -23,7 +23,7 @@
%1 = sext i32 %i.01 to i64 ; <i64> [#uses=1]
; CHECK: %2 = getelementptr inbounds double* %d, i64 %1
-; CHECK: --> {%d,+,16}<nuw><%bb>
+; CHECK: --> {%d,+,16}<nsw><%bb>
%2 = getelementptr inbounds double* %d, i64 %1 ; <double*> [#uses=1]
%3 = load double* %2, align 8 ; <double> [#uses=1]
@@ -37,7 +37,7 @@
%8 = sext i32 %7 to i64 ; <i64> [#uses=1]
; CHECK: %9 = getelementptr inbounds double* %q, i64 %8
-; CHECK: {(8 + %q),+,16}<nuw><%bb>
+; CHECK: {(8 + %q),+,16}<nsw><%bb>
%9 = getelementptr inbounds double* %q, i64 %8 ; <double*> [#uses=1]
; Artificially repeat the above three instructions, this time using
@@ -49,7 +49,7 @@
%t8 = sext i32 %t7 to i64 ; <i64> [#uses=1]
; CHECK: %t9 = getelementptr inbounds double* %q, i64 %t8
-; CHECK: {(8 + %q),+,16}<nuw><%bb>
+; CHECK: {(8 + %q),+,16}<nsw><%bb>
%t9 = getelementptr inbounds double* %q, i64 %t8 ; <double*> [#uses=1]
%10 = load double* %9, align 8 ; <double> [#uses=1]
Modified: llvm/trunk/test/Analysis/ScalarEvolution/nsw.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/nsw.ll?rev=154910&r1=154909&r2=154910&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/ScalarEvolution/nsw.ll (original)
+++ llvm/trunk/test/Analysis/ScalarEvolution/nsw.ll Tue Apr 17 01:33:57 2012
@@ -92,10 +92,10 @@
; CHECK: {1,+,1}<nuw><nsw><%for.body.i.i>
%ptrincdec.i.i = getelementptr inbounds i32* %begin, i64 %tmp
; CHECK: %ptrincdec.i.i =
-; CHECK: {(4 + %begin),+,4}<nuw><%for.body.i.i>
+; CHECK: {(4 + %begin),+,4}<nsw><%for.body.i.i>
%__first.addr.08.i.i = getelementptr inbounds i32* %begin, i64 %indvar.i.i
; CHECK: %__first.addr.08.i.i
-; CHECK: {%begin,+,4}<nuw><%for.body.i.i>
+; CHECK: {%begin,+,4}<nsw><%for.body.i.i>
store i32 0, i32* %__first.addr.08.i.i, align 4
%cmp.i.i = icmp eq i32* %ptrincdec.i.i, %end
br i1 %cmp.i.i, label %_ZSt4fillIPiiEvT_S1_RKT0_.exit, label %for.body.i.i
More information about the llvm-commits
mailing list