diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2018-02-17 01:18:53 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2018-02-17 01:18:53 +0000 |
| commit | 841ca95219c9ddb8241372a592b5b923a0087a2a (patch) | |
| tree | 59f389ac6f31a92b640a080db2d268ce555f0c87 | |
| parent | caca8d5db33c9f33521ad0c5184f8487903c4a8d (diff) | |
| download | bcm5719-llvm-841ca95219c9ddb8241372a592b5b923a0087a2a.tar.gz bcm5719-llvm-841ca95219c9ddb8241372a592b5b923a0087a2a.zip | |
[InstSimplify] add vector select tests with undef elts in condition; NFC
llvm-svn: 325419
| -rw-r--r-- | llvm/test/Transforms/InstSimplify/select.ll | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstSimplify/select.ll b/llvm/test/Transforms/InstSimplify/select.ll index e1b7877c17a..c4df76d4535 100644 --- a/llvm/test/Transforms/InstSimplify/select.ll +++ b/llvm/test/Transforms/InstSimplify/select.ll @@ -25,6 +25,26 @@ define <2 x i8> @vsel_mixedvec() { ret <2 x i8> %s } +; FIXME: Allow for undef elements in a constant vector condition. + +define <3 x i8> @vsel_undef_true_op(<3 x i8> %x, <3 x i8> %y) { +; CHECK-LABEL: @vsel_undef_true_op( +; CHECK-NEXT: [[S:%.*]] = select <3 x i1> <i1 true, i1 undef, i1 true>, <3 x i8> [[X:%.*]], <3 x i8> [[Y:%.*]] +; CHECK-NEXT: ret <3 x i8> [[S]] +; + %s = select <3 x i1><i1 1, i1 undef, i1 1>, <3 x i8> %x, <3 x i8> %y + ret <3 x i8> %s +} + +define <3 x i4> @vsel_undef_false_op(<3 x i4> %x, <3 x i4> %y) { +; CHECK-LABEL: @vsel_undef_false_op( +; CHECK-NEXT: [[S:%.*]] = select <3 x i1> <i1 false, i1 undef, i1 undef>, <3 x i4> [[X:%.*]], <3 x i4> [[Y:%.*]] +; CHECK-NEXT: ret <3 x i4> [[S]] +; + %s = select <3 x i1><i1 0, i1 undef, i1 undef>, <3 x i4> %x, <3 x i4> %y + ret <3 x i4> %s +} + define i32 @test1(i32 %x) { ; CHECK-LABEL: @test1( ; CHECK-NEXT: ret i32 %x |

