diff options
| author | Haicheng Wu <haicheng@codeaurora.org> | 2017-10-02 23:43:52 +0000 |
|---|---|---|
| committer | Haicheng Wu <haicheng@codeaurora.org> | 2017-10-02 23:43:52 +0000 |
| commit | 25f6c196d7035be8cb818be95856c44c2356d3b9 (patch) | |
| tree | 4b128129254914f60d5e73796bff68b05a160ae8 /llvm/test/Transforms/InstSimplify/select.ll | |
| parent | c48d1c8519816210cf4baa7be68672bd8ba91532 (diff) | |
| download | bcm5719-llvm-25f6c196d7035be8cb818be95856c44c2356d3b9.tar.gz bcm5719-llvm-25f6c196d7035be8cb818be95856c44c2356d3b9.zip | |
[InstSimplify] teach SimplifySelectInst() to fold more vector selects
Call ConstantFoldSelectInstruction() to fold cases like below
select <2 x i1><i1 true, i1 false>, <2 x i8> <i8 0, i8 1>, <2 x i8> <i8 2, i8 3>
All operands are constants and the condition has mixed true and false conditions.
Differential Revision: https://reviews.llvm.org/D38369
llvm-svn: 314741
Diffstat (limited to 'llvm/test/Transforms/InstSimplify/select.ll')
| -rw-r--r-- | llvm/test/Transforms/InstSimplify/select.ll | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstSimplify/select.ll b/llvm/test/Transforms/InstSimplify/select.ll index 7ede76d4dfa..e1b7877c17a 100644 --- a/llvm/test/Transforms/InstSimplify/select.ll +++ b/llvm/test/Transforms/InstSimplify/select.ll @@ -17,6 +17,14 @@ define <2 x i8> @vsel_fvec(<2 x i8> %x, <2 x i8> %y) { ret <2 x i8> %s } +define <2 x i8> @vsel_mixedvec() { +; CHECK-LABEL: @vsel_mixedvec( +; CHECK-NEXT: ret <2 x i8> <i8 0, i8 3> +; + %s = select <2 x i1><i1 true, i1 false>, <2 x i8> <i8 0, i8 1>, <2 x i8> <i8 2, i8 3> + ret <2 x i8> %s +} + define i32 @test1(i32 %x) { ; CHECK-LABEL: @test1( ; CHECK-NEXT: ret i32 %x |

