summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/and-compare.ll
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-08-28 18:18:00 +0000
committerSanjay Patel <spatel@rotateright.com>2016-08-28 18:18:00 +0000
commit5c5311f4e50828ae1e2ad597c5d715c2dedd836a (patch)
tree934ed8c10d9e80baad921ade2fd4c148088d3cc2 /llvm/test/Transforms/InstCombine/and-compare.ll
parent4b3308c27feaed28ea2f08860cc2f9aec3c4d642 (diff)
downloadbcm5719-llvm-5c5311f4e50828ae1e2ad597c5d715c2dedd836a.tar.gz
bcm5719-llvm-5c5311f4e50828ae1e2ad597c5d715c2dedd836a.zip
[InstCombine] use m_APInt to allow icmp (and X, Y), C folds for splat constant vectors
llvm-svn: 279937
Diffstat (limited to 'llvm/test/Transforms/InstCombine/and-compare.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/and-compare.ll10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/test/Transforms/InstCombine/and-compare.ll b/llvm/test/Transforms/InstCombine/and-compare.ll
index ce6894f9b8e..d4aa1c5488b 100644
--- a/llvm/test/Transforms/InstCombine/and-compare.ll
+++ b/llvm/test/Transforms/InstCombine/and-compare.ll
@@ -42,11 +42,10 @@ define i1 @test2(i64 %A) {
ret i1 %cmp
}
-; FIXME: Vectors should fold the same way.
define <2 x i1> @test2vec(<2 x i64> %A) {
; CHECK-LABEL: @test2vec(
-; CHECK-NEXT: [[AND:%.*]] = and <2 x i64> %A, <i64 128, i64 128>
-; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i64> [[AND]], zeroinitializer
+; CHECK-NEXT: [[TMP1:%.*]] = trunc <2 x i64> %A to <2 x i8>
+; CHECK-NEXT: [[CMP:%.*]] = icmp sgt <2 x i8> [[TMP1]], <i8 -1, i8 -1>
; CHECK-NEXT: ret <2 x i1> [[CMP]]
;
%and = and <2 x i64> %A, <i64 128, i64 128>
@@ -65,11 +64,10 @@ define i1 @test3(i64 %A) {
ret i1 %cmp
}
-; FIXME: Vectors should fold the same way.
define <2 x i1> @test3vec(<2 x i64> %A) {
; CHECK-LABEL: @test3vec(
-; CHECK-NEXT: [[AND:%.*]] = and <2 x i64> %A, <i64 128, i64 128>
-; CHECK-NEXT: [[CMP:%.*]] = icmp ne <2 x i64> [[AND]], zeroinitializer
+; CHECK-NEXT: [[TMP1:%.*]] = trunc <2 x i64> %A to <2 x i8>
+; CHECK-NEXT: [[CMP:%.*]] = icmp slt <2 x i8> [[TMP1]], zeroinitializer
; CHECK-NEXT: ret <2 x i1> [[CMP]]
;
%and = and <2 x i64> %A, <i64 128, i64 128>
OpenPOWER on IntegriCloud