summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2011-07-09 00:36:54 +0000
committerLang Hames <lhames@gmail.com>2011-07-09 00:36:54 +0000
commitf86a54741934e146e3aa0e32c0dfe1c58c3ba79d (patch)
treec4cd5634033d3532abb07dff571e9d9f5acc8153 /test
parentbd1828c6ed8e699dc3efe69271e58085f35a5db3 (diff)
downloadllvm-f86a54741934e146e3aa0e32c0dfe1c58c3ba79d.tar.gz
llvm-f86a54741934e146e3aa0e32c0dfe1c58c3ba79d.tar.bz2
llvm-f86a54741934e146e3aa0e32c0dfe1c58c3ba79d.tar.xz
Added test cases for GVN signed intrinsics recognition, r134777.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134778 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/GVN/2011-07-07-MatchIntrinsicExtract.ll38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/Transforms/GVN/2011-07-07-MatchIntrinsicExtract.ll b/test/Transforms/GVN/2011-07-07-MatchIntrinsicExtract.ll
index a2ef4ab418..18178e45a2 100644
--- a/test/Transforms/GVN/2011-07-07-MatchIntrinsicExtract.ll
+++ b/test/Transforms/GVN/2011-07-07-MatchIntrinsicExtract.ll
@@ -39,9 +39,47 @@ entry:
; CHECK-NOT: mul1
; CHECK: ret
+define i64 @test4(i64 %a, i64 %b) nounwind ssp {
+entry:
+ %sadd = tail call %0 @llvm.sadd.with.overflow.i64(i64 %a, i64 %b)
+ %sadd.0 = extractvalue %0 %sadd, 0
+ %add1 = add i64 %a, %b
+ ret i64 %add1
+}
+
+; CHECK: @test4
+; CHECK-NOT: add1
+; CHECK: ret
+
+define i64 @test5(i64 %a, i64 %b) nounwind ssp {
+entry:
+ %ssub = tail call %0 @llvm.ssub.with.overflow.i64(i64 %a, i64 %b)
+ %ssub.0 = extractvalue %0 %ssub, 0
+ %sub1 = sub i64 %a, %b
+ ret i64 %sub1
+}
+
+; CHECK: @test5
+; CHECK-NOT: sub1
+; CHECK: ret
+
+define i64 @test6(i64 %a, i64 %b) nounwind ssp {
+entry:
+ %smul = tail call %0 @llvm.smul.with.overflow.i64(i64 %a, i64 %b)
+ %smul.0 = extractvalue %0 %smul, 0
+ %mul1 = mul i64 %a, %b
+ ret i64 %mul1
+}
+
+; CHECK: @test6
+; CHECK-NOT: mul1
+; CHECK: ret
declare void @exit(i32) noreturn
declare %0 @llvm.uadd.with.overflow.i64(i64, i64) nounwind readnone
declare %0 @llvm.usub.with.overflow.i64(i64, i64) nounwind readnone
declare %0 @llvm.umul.with.overflow.i64(i64, i64) nounwind readnone
+declare %0 @llvm.sadd.with.overflow.i64(i64, i64) nounwind readnone
+declare %0 @llvm.ssub.with.overflow.i64(i64, i64) nounwind readnone
+declare %0 @llvm.smul.with.overflow.i64(i64, i64) nounwind readnone