summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r--llvm/test/Transforms/InstCombine/and.ll8
-rw-r--r--llvm/test/Transforms/InstCombine/icmp.ll6
2 files changed, 5 insertions, 9 deletions
diff --git a/llvm/test/Transforms/InstCombine/and.ll b/llvm/test/Transforms/InstCombine/and.ll
index 9a6ae74cc7e..5b48f330495 100644
--- a/llvm/test/Transforms/InstCombine/and.ll
+++ b/llvm/test/Transforms/InstCombine/and.ll
@@ -196,11 +196,9 @@ define i1 @test18(i32 %A) {
ret i1 %C
}
-; FIXME: Vectors should fold the same way.
define <2 x i1> @test18_vec(<2 x i32> %A) {
; CHECK-LABEL: @test18_vec(
-; CHECK-NEXT: [[B:%.*]] = and <2 x i32> %A, <i32 -128, i32 -128>
-; CHECK-NEXT: [[C:%.*]] = icmp ne <2 x i32> [[B]], zeroinitializer
+; CHECK-NEXT: [[C:%.*]] = icmp ugt <2 x i32> %A, <i32 127, i32 127>
; CHECK-NEXT: ret <2 x i1> [[C]]
;
%B = and <2 x i32> %A, <i32 -128, i32 -128>
@@ -218,11 +216,9 @@ define i1 @test18a(i8 %A) {
ret i1 %C
}
-; FIXME: Vectors should fold the same way.
define <2 x i1> @test18a_vec(<2 x i8> %A) {
; CHECK-LABEL: @test18a_vec(
-; CHECK-NEXT: [[B:%.*]] = and <2 x i8> %A, <i8 -2, i8 -2>
-; CHECK-NEXT: [[C:%.*]] = icmp eq <2 x i8> [[B]], zeroinitializer
+; CHECK-NEXT: [[C:%.*]] = icmp ult <2 x i8> %A, <i8 2, i8 2>
; CHECK-NEXT: ret <2 x i1> [[C]]
;
%B = and <2 x i8> %A, <i8 -2, i8 -2>
diff --git a/llvm/test/Transforms/InstCombine/icmp.ll b/llvm/test/Transforms/InstCombine/icmp.ll
index db84eba543e..88cf0cdd943 100644
--- a/llvm/test/Transforms/InstCombine/icmp.ll
+++ b/llvm/test/Transforms/InstCombine/icmp.ll
@@ -205,11 +205,12 @@ define i1 @test19(i32 %x) {
}
; FIXME: Vectors should fold the same way.
+
define <2 x i1> @test19vec(<2 x i32> %x) {
; CHECK-LABEL: @test19vec(
; CHECK-NEXT: [[SHL:%.*]] = shl <2 x i32> <i32 1, i32 1>, %x
; CHECK-NEXT: [[AND:%.*]] = and <2 x i32> [[SHL]], <i32 8, i32 8>
-; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i32> [[AND]], <i32 8, i32 8>
+; CHECK-NEXT: [[CMP:%.*]] = icmp ne <2 x i32> [[AND]], zeroinitializer
; CHECK-NEXT: ret <2 x i1> [[CMP]]
;
%shl = shl <2 x i32> <i32 1, i32 1>, %x
@@ -220,8 +221,7 @@ define <2 x i1> @test19vec(<2 x i32> %x) {
define <2 x i1> @cmp_and_signbit_vec(<2 x i3> %x) {
; CHECK-LABEL: @cmp_and_signbit_vec(
-; CHECK-NEXT: [[AND:%.*]] = and <2 x i3> %x, <i3 -4, i3 -4>
-; CHECK-NEXT: [[CMP:%.*]] = icmp ne <2 x i3> [[AND]], zeroinitializer
+; CHECK-NEXT: [[CMP:%.*]] = icmp slt <2 x i3> %x, zeroinitializer
; CHECK-NEXT: ret <2 x i1> [[CMP]]
;
%and = and <2 x i3> %x, <i3 4, i3 4>
OpenPOWER on IntegriCloud