summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2018-12-20 19:46:52 +0000
committerNikita Popov <nikita.ppv@gmail.com>2018-12-20 19:46:52 +0000
commitf17421e595fe1becbc57fa873ec6278fd7fce188 (patch)
tree90548d2f61f52be80abc5228eaa326875b28734e /llvm/test/Transforms
parent6d79e43208a5afd4e4dc100249f5f0cbf43e8571 (diff)
downloadbcm5719-llvm-f17421e595fe1becbc57fa873ec6278fd7fce188.tar.gz
bcm5719-llvm-f17421e595fe1becbc57fa873ec6278fd7fce188.zip
[ConstantFolding] Consolidate and extend bitcount intrinsic tests; NFC
Move constant folding tests into ConstantFolding/bitcount.ll and drop various tests in other places. Add coverage for undefs. llvm-svn: 349806
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r--llvm/test/Transforms/ConstProp/2007-11-23-cttz.ll8
-rw-r--r--llvm/test/Transforms/InstCombine/bitcount.ll19
-rw-r--r--llvm/test/Transforms/InstSimplify/call.ll30
3 files changed, 0 insertions, 57 deletions
diff --git a/llvm/test/Transforms/ConstProp/2007-11-23-cttz.ll b/llvm/test/Transforms/ConstProp/2007-11-23-cttz.ll
deleted file mode 100644
index c5ee70c2ff1..00000000000
--- a/llvm/test/Transforms/ConstProp/2007-11-23-cttz.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: opt < %s -constprop -S | grep "ret i13 13"
-; PR1816
-declare i13 @llvm.cttz.i13(i13, i1)
-
-define i13 @test() {
- %X = call i13 @llvm.cttz.i13(i13 0, i1 false)
- ret i13 %X
-}
diff --git a/llvm/test/Transforms/InstCombine/bitcount.ll b/llvm/test/Transforms/InstCombine/bitcount.ll
deleted file mode 100644
index 318ca7339f1..00000000000
--- a/llvm/test/Transforms/InstCombine/bitcount.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; Tests to make sure bit counts of constants are folded
-; RUN: opt < %s -instcombine -S | grep "ret i32 19"
-; RUN: opt < %s -instcombine -S | \
-; RUN: grep -v declare | not grep llvm.ct
-
-declare i31 @llvm.ctpop.i31(i31 %val)
-declare i32 @llvm.cttz.i32(i32 %val, i1)
-declare i33 @llvm.ctlz.i33(i33 %val, i1)
-
-define i32 @test(i32 %A) {
- %c1 = call i31 @llvm.ctpop.i31(i31 12415124)
- %c2 = call i32 @llvm.cttz.i32(i32 87359874, i1 true)
- %c3 = call i33 @llvm.ctlz.i33(i33 87359874, i1 true)
- %t1 = zext i31 %c1 to i32
- %t3 = trunc i33 %c3 to i32
- %r1 = add i32 %t1, %c2
- %r2 = add i32 %r1, %t3
- ret i32 %r2
-}
diff --git a/llvm/test/Transforms/InstSimplify/call.ll b/llvm/test/Transforms/InstSimplify/call.ll
index b3a2f96870e..9d63d375afb 100644
--- a/llvm/test/Transforms/InstSimplify/call.ll
+++ b/llvm/test/Transforms/InstSimplify/call.ll
@@ -189,36 +189,6 @@ define {i8, i1} @test_smul4(i8 %V) {
ret {i8, i1} %x
}
-declare i256 @llvm.cttz.i256(i256 %src, i1 %is_zero_undef)
-
-define i256 @test_cttz() {
-; CHECK-LABEL: @test_cttz(
-; CHECK-NEXT: ret i256 1
-;
- %x = call i256 @llvm.cttz.i256(i256 10, i1 false)
- ret i256 %x
-}
-
-declare <2 x i256> @llvm.cttz.v2i256(<2 x i256> %src, i1 %is_zero_undef)
-
-define <2 x i256> @test_cttz_vec() {
-; CHECK-LABEL: @test_cttz_vec(
-; CHECK-NEXT: ret <2 x i256> <i256 1, i256 1>
-;
- %x = call <2 x i256> @llvm.cttz.v2i256(<2 x i256> <i256 10, i256 10>, i1 false)
- ret <2 x i256> %x
-}
-
-declare i256 @llvm.ctpop.i256(i256 %src)
-
-define i256 @test_ctpop() {
-; CHECK-LABEL: @test_ctpop(
-; CHECK-NEXT: ret i256 2
-;
- %x = call i256 @llvm.ctpop.i256(i256 10)
- ret i256 %x
-}
-
; Test a non-intrinsic that we know about as a library call.
declare float @fabs(float %x)
OpenPOWER on IntegriCloud