Revert some changes that were made to fix PR20680.

This re-lands change r230921.  r230921 was reverted because it broke a
clang test; a checkin fixing the clang test will be commited shortly.

Summary:
As far as I can tell, the real bug causing the issue was fixed in
r230533.  SCEVExpander should mark an increment operation as nuw or nsw
only if it can *prove* that the operation does not overflow.  There
shouldn't be any situation where we have to do something different
because of no-wrap flags generated by SCEVExpander.

Revert "IndVarSimplify: Allow LFTR to fire more often"

This reverts commit 1ade0f0faa (SVN: 222213).

Revert "IndVarSimplify: Don't let LFTR compare against a poison value"

This reverts commit c0f2b8b528 (SVN: 217102).

Reviewers: majnemer, atrick, spatel

Differential Revision: http://reviews.llvm.org/D7979

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231018 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Sanjoy Das
2015-03-02 21:41:07 +00:00
parent 2dc2d3f820
commit caee94bbb4
4 changed files with 17 additions and 61 deletions

View File

@@ -6,7 +6,7 @@ target triple = "thumbv7-apple-darwin"
; CHECK-LABEL: @test(
; CHECK: if.end.i126:
; CHECK: %exitcond = icmp ne i8* %destYPixelPtr.010.i, getelementptr (i8* null, i32 undef)
; CHECK: %exitcond = icmp ne i8* %incdec.ptr.i, getelementptr (i8* null, i32 undef)
define void @test() nounwind {
entry:
br label %while.cond

View File

@@ -11,7 +11,7 @@ entry:
br i1 %cmp1, label %for.body, label %for.end
; Make sure the added GEP has the right index type
; CHECK: %lftr.limit = getelementptr i8, i8 addrspace(2)* %base, i8
; CHECK: %lftr.limit = getelementptr i8, i8 addrspace(2)* %base, i8 %0
; CHECK: for.body:
; CHECK: phi i8 addrspace(2)*
@@ -43,7 +43,7 @@ entry:
br i1 %cmp1, label %for.body, label %for.end
; Make sure the added GEP has the right index type
; CHECK: %lftr.limit = getelementptr i8, i8 addrspace(3)* %base, i16
; CHECK: %lftr.limit = getelementptr i8, i8 addrspace(3)* %base, i16 %0
; CHECK: for.body:
; CHECK: phi i8 addrspace(3)*

View File

@@ -82,23 +82,15 @@ exit:
; Perform LFTR without generating extra preheader code.
define void @guardedloop([0 x double]* %matrix, [0 x double]* %vector,
i32 %irow, i32 %ilead) nounwind {
; CHECK-LABEL: @guardedloop(
; CHECK-LABEL: entry:
; CHECK-NEXT: %[[cmp:.*]] = icmp slt i32 1, %irow
; CHECK-NEXT: br i1 %[[cmp]], label %[[loop_preheader:.*]], label %[[return:.*]]
; CHECK: [[loop_preheader]]:
; CHECK-NEXT: %[[sext:.*]] = sext i32 %ilead to i64
; CHECK-NEXT: %[[add:.*]] = add i32 %irow, -1
; CHECK-NEXT: br label %[[loop:.*]]
; CHECK: [[loop]]:
; CHECK-NEXT: %[[indvars_iv2:.*]] = phi i64
; CHECK-NEXT: phi i64
; CHECK: entry:
; CHECK-NOT: zext
; CHECK-NOT: add
; CHECK: loop:
; CHECK: phi i64
; CHECK: phi i64
; CHECK-NOT: phi
; CHECK: %[[lftr_wideiv:.*]] = trunc i64 %[[indvars_iv2]] to i32
; CHECK-NEXT: %[[exitcond:.*]] = icmp ne i32 %[[lftr_wideiv]], %[[add]]
; CHECK-NEXT: br i1 %[[exitcond]], label %[[loop]], label
; CHECK: icmp ne
; CHECK: br i1
entry:
%cmp = icmp slt i32 1, %irow
br i1 %cmp, label %loop, label %return