summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-03-03 18:00:15 +0000
committerSanjay Patel <spatel@rotateright.com>2018-03-03 18:00:15 +0000
commit9119b844a39df87f624dfc55657800d38c6ccece (patch)
tree2abff3b10407a2c4dda2ac8b2eeb0b3f88ca2bad
parent1a8d5c3d1f43ebf7b07f1f009797e7d3eccebc60 (diff)
downloadbcm5719-llvm-9119b844a39df87f624dfc55657800d38c6ccece.tar.gz
bcm5719-llvm-9119b844a39df87f624dfc55657800d38c6ccece.zip
[InstCombine] add test for vectors with undef elts; NFC
llvm-svn: 326661
-rw-r--r--llvm/test/Transforms/InstCombine/sub.ll15
1 files changed, 14 insertions, 1 deletions
diff --git a/llvm/test/Transforms/InstCombine/sub.ll b/llvm/test/Transforms/InstCombine/sub.ll
index 405320ba74c..0d4f87714b9 100644
--- a/llvm/test/Transforms/InstCombine/sub.ll
+++ b/llvm/test/Transforms/InstCombine/sub.ll
@@ -40,7 +40,6 @@ define i32 @test4(i32 %A, i32 %x) {
ret i32 %C
}
-; FIXME:
; (~X) - (~Y) --> Y - X
; Also, show that we can handle extra uses and vectors.
@@ -74,6 +73,20 @@ define <2 x i8> @notnotsub_vec(<2 x i8> %x, <2 x i8> %y) {
ret <2 x i8> %sub
}
+; FIXME:
+define <2 x i8> @notnotsub_vec_undef_elts(<2 x i8> %x, <2 x i8> %y) {
+; CHECK-LABEL: @notnotsub_vec_undef_elts(
+; CHECK-NEXT: [[NX:%.*]] = xor <2 x i8> [[X:%.*]], <i8 undef, i8 -1>
+; CHECK-NEXT: [[NY:%.*]] = xor <2 x i8> [[Y:%.*]], <i8 -1, i8 undef>
+; CHECK-NEXT: [[SUB:%.*]] = sub <2 x i8> [[NX]], [[NY]]
+; CHECK-NEXT: ret <2 x i8> [[SUB]]
+;
+ %nx = xor <2 x i8> %x, <i8 undef, i8 -1>
+ %ny = xor <2 x i8> %y, <i8 -1, i8 undef>
+ %sub = sub <2 x i8> %nx, %ny
+ ret <2 x i8> %sub
+}
+
define i32 @test5(i32 %A, i32 %B, i32 %C) {
; CHECK-LABEL: @test5(
; CHECK-NEXT: [[D1:%.*]] = sub i32 [[C:%.*]], [[B:%.*]]
OpenPOWER on IntegriCloud