summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/shift.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Transforms/InstCombine/shift.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/shift.ll17
1 files changed, 6 insertions, 11 deletions
diff --git a/llvm/test/Transforms/InstCombine/shift.ll b/llvm/test/Transforms/InstCombine/shift.ll
index 537e5cd951d..a91038f9eff 100644
--- a/llvm/test/Transforms/InstCombine/shift.ll
+++ b/llvm/test/Transforms/InstCombine/shift.ll
@@ -320,11 +320,10 @@ define i1 @test17(i32 %A) {
ret i1 %C
}
-; FIXME: Vectors should fold the same way.
define <2 x i1> @test17vec(<2 x i32> %A) {
; CHECK-LABEL: @test17vec(
-; CHECK-NEXT: [[B:%.*]] = lshr <2 x i32> %A, <i32 3, i32 3>
-; CHECK-NEXT: [[C:%.*]] = icmp eq <2 x i32> [[B]], <i32 1234, i32 1234>
+; CHECK-NEXT: [[B_MASK:%.*]] = and <2 x i32> %A, <i32 -8, i32 -8>
+; CHECK-NEXT: [[C:%.*]] = icmp eq <2 x i32> [[B_MASK]], <i32 9872, i32 9872>
; CHECK-NEXT: ret <2 x i1> [[C]]
;
%B = lshr <2 x i32> %A, <i32 3, i32 3>
@@ -353,11 +352,9 @@ define i1 @test19(i32 %A) {
ret i1 %C
}
-; FIXME: Vectors should fold the same way.
define <2 x i1> @test19vec(<2 x i32> %A) {
; CHECK-LABEL: @test19vec(
-; CHECK-NEXT: [[B:%.*]] = ashr <2 x i32> %A, <i32 2, i32 2>
-; CHECK-NEXT: [[C:%.*]] = icmp eq <2 x i32> [[B]], zeroinitializer
+; CHECK-NEXT: [[C:%.*]] = icmp ult <2 x i32> %A, <i32 4, i32 4>
; CHECK-NEXT: ret <2 x i1> [[C]]
;
%B = ashr <2 x i32> %A, <i32 2, i32 2>
@@ -379,8 +376,8 @@ define i1 @test19a(i32 %A) {
; FIXME: Vectors should fold the same way.
define <2 x i1> @test19a_vec(<2 x i32> %A) {
; CHECK-LABEL: @test19a_vec(
-; CHECK-NEXT: [[B:%.*]] = ashr <2 x i32> %A, <i32 2, i32 2>
-; CHECK-NEXT: [[C:%.*]] = icmp eq <2 x i32> [[B]], <i32 -1, i32 -1>
+; CHECK-NEXT: [[B_MASK:%.*]] = and <2 x i32> %A, <i32 -4, i32 -4>
+; CHECK-NEXT: [[C:%.*]] = icmp eq <2 x i32> [[B_MASK]], <i32 -4, i32 -4>
; CHECK-NEXT: ret <2 x i1> [[C]]
;
%B = ashr <2 x i32> %A, <i32 2, i32 2>
@@ -506,11 +503,9 @@ define i1 @test28(i8 %x) {
ret i1 %cmp
}
-; FIXME: Vectors should fold the same way.
define <2 x i1> @test28vec(<2 x i8> %x) {
; CHECK-LABEL: @test28vec(
-; CHECK-NEXT: [[SHR:%.*]] = lshr <2 x i8> %x, <i8 7, i8 7>
-; CHECK-NEXT: [[CMP:%.*]] = icmp ne <2 x i8> [[SHR]], zeroinitializer
+; CHECK-NEXT: [[CMP:%.*]] = icmp slt <2 x i8> %x, zeroinitializer
; CHECK-NEXT: ret <2 x i1> [[CMP]]
;
%shr = lshr <2 x i8> %x, <i8 7, i8 7>
OpenPOWER on IntegriCloud