summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-06-03 18:50:32 +0000
committerCraig Topper <craig.topper@gmail.com>2017-06-03 18:50:32 +0000
commit0799ff9e64b80e752a674d7a9dafea4f9d7f4761 (patch)
tree176670b9a370be914ae5bda3db0ac845152cb91b /llvm/test
parent7c553edcedca1c085af33906eb4549114da21f34 (diff)
downloadbcm5719-llvm-0799ff9e64b80e752a674d7a9dafea4f9d7f4761.tar.gz
bcm5719-llvm-0799ff9e64b80e752a674d7a9dafea4f9d7f4761.zip
[InstCombine] Add support for simplifying ctlz/cttz intrinsics based on known bits.
llvm-svn: 304669
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/InstCombine/intrinsics.ll14
1 files changed, 4 insertions, 10 deletions
diff --git a/llvm/test/Transforms/InstCombine/intrinsics.ll b/llvm/test/Transforms/InstCombine/intrinsics.ll
index abe0c784754..1b1ed606868 100644
--- a/llvm/test/Transforms/InstCombine/intrinsics.ll
+++ b/llvm/test/Transforms/InstCombine/intrinsics.ll
@@ -285,10 +285,7 @@ define i32 @cttz(i32 %a) {
define <2 x i32> @cttz_vec(<2 x i32> %a) {
; CHECK-LABEL: @cttz_vec(
-; CHECK-NEXT: [[OR:%.*]] = or <2 x i32> [[A:%.*]], <i32 8, i32 8>
-; CHECK-NEXT: [[AND:%.*]] = and <2 x i32> [[OR]], <i32 -8, i32 -8>
-; CHECK-NEXT: [[COUNT:%.*]] = tail call <2 x i32> @llvm.cttz.v2i32(<2 x i32> [[AND]], i1 true)
-; CHECK-NEXT: ret <2 x i32> [[COUNT]]
+; CHECK-NEXT: ret <2 x i32> <i32 3, i32 3>
;
%or = or <2 x i32> %a, <i32 8, i32 8>
%and = and <2 x i32> %or, <i32 -8, i32 -8>
@@ -382,10 +379,7 @@ define i8 @ctlz(i8 %a) {
define <2 x i8> @ctlz_vec(<2 x i8> %a) {
; CHECK-LABEL: @ctlz_vec(
-; CHECK-NEXT: [[OR:%.*]] = or <2 x i8> [[A:%.*]], <i8 32, i8 32>
-; CHECK-NEXT: [[AND:%.*]] = and <2 x i8> [[OR]], <i8 63, i8 63>
-; CHECK-NEXT: [[COUNT:%.*]] = tail call <2 x i8> @llvm.ctlz.v2i8(<2 x i8> [[AND]], i1 true)
-; CHECK-NEXT: ret <2 x i8> [[COUNT]]
+; CHECK-NEXT: ret <2 x i8> <i8 2, i8 2>
;
%or = or <2 x i8> %a, <i8 32, i8 32>
%and = and <2 x i8> %or, <i8 63, i8 63>
@@ -556,7 +550,7 @@ define i32 @ctlz_make_undef(i32 %a) {
define <2 x i32> @ctlz_make_undef_vec(<2 x i32> %a) {
; CHECK-LABEL: @ctlz_make_undef_vec(
; CHECK-NEXT: [[OR:%.*]] = or <2 x i32> [[A:%.*]], <i32 8, i32 8>
-; CHECK-NEXT: [[CTLZ:%.*]] = tail call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> [[OR]], i1 false)
+; CHECK-NEXT: [[CTLZ:%.*]] = tail call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> [[OR]], i1 true)
; CHECK-NEXT: ret <2 x i32> [[CTLZ]]
;
%or = or <2 x i32> %a, <i32 8, i32 8>
@@ -593,7 +587,7 @@ define i32 @cttz_make_undef(i32 %a) {
define <2 x i32> @cttz_make_undef_vec(<2 x i32> %a) {
; CHECK-LABEL: @cttz_make_undef_vec(
; CHECK-NEXT: [[OR:%.*]] = or <2 x i32> [[A:%.*]], <i32 8, i32 8>
-; CHECK-NEXT: [[CTTZ:%.*]] = tail call <2 x i32> @llvm.cttz.v2i32(<2 x i32> [[OR]], i1 false)
+; CHECK-NEXT: [[CTTZ:%.*]] = tail call <2 x i32> @llvm.cttz.v2i32(<2 x i32> [[OR]], i1 true)
; CHECK-NEXT: ret <2 x i32> [[CTTZ]]
;
%or = or <2 x i32> %a, <i32 8, i32 8>
OpenPOWER on IntegriCloud