aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2012-07-03 17:30:18 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2012-07-03 17:30:18 +0000
commit42d80c7a5b369285c10c0dc4b2e025f7a65d635e (patch)
treee220c91a009529fa7d2192da7e6d959c1c135dea /test/Transforms
parent0dff532fce434c3e9fdf9695aed8efeb5f752ed5 (diff)
downloadexternal_llvm-42d80c7a5b369285c10c0dc4b2e025f7a65d635e.zip
external_llvm-42d80c7a5b369285c10c0dc4b2e025f7a65d635e.tar.gz
external_llvm-42d80c7a5b369285c10c0dc4b2e025f7a65d635e.tar.bz2
BoundsChecking: optimize out the check for offset < 0 if size is known to be >= 0 (signed).
(LLVM optimizers cannot do this optimization by themselves) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159668 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/BoundsChecking/phi.ll8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/Transforms/BoundsChecking/phi.ll b/test/Transforms/BoundsChecking/phi.ll
index 6c42ec8..86b5922 100644
--- a/test/Transforms/BoundsChecking/phi.ll
+++ b/test/Transforms/BoundsChecking/phi.ll
@@ -34,10 +34,14 @@ while.body.i.preheader:
while.body.i:
; CHECK: phi
; CHECK-NEXT: phi
-; CHECK-NEXT: phi
-; CHECK: trap
+; CHECK-NOT: phi
%c.addr.02.i = phi i8* [ %incdec.ptr.i, %while.body.i ], [ %addr, %while.body.i.preheader ]
%incdec.ptr.i = getelementptr inbounds i8* %c.addr.02.i, i64 -1
+; CHECK: sub i64 10, %0
+; CHECK-NEXT: icmp ult i64 10, %0
+; CHECK-NEXT: icmp ult i64 {{.*}}, 1
+; CHECK-NEXT: or i1
+; CHECK-NEXT: br {{.*}}, label %trap
store i8 100, i8* %c.addr.02.i, align 1
%0 = load i8* %incdec.ptr.i, align 1
%tobool.i = icmp eq i8 %0, 0