diff options
author | Sanjay Patel <spatel@rotateright.com> | 2016-09-30 19:15:41 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2016-09-30 19:15:41 +0000 |
commit | 75b25187627bbf78453f2cefb24fa28a07ceb289 (patch) | |
tree | 327355ae6300321e8d4bcd2fd4d20d7f0e79e3b1 /llvm | |
parent | ed95a08ea4e7bf62d7dc71388b61991de065da5b (diff) | |
download | bcm5719-llvm-75b25187627bbf78453f2cefb24fa28a07ceb289.tar.gz bcm5719-llvm-75b25187627bbf78453f2cefb24fa28a07ceb289.zip |
[InstCombine] add tests for non-splat select(ext)
llvm-svn: 282901
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/test/Transforms/InstCombine/select-bitext.ll | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/select-bitext.ll b/llvm/test/Transforms/InstCombine/select-bitext.ll index 34e260a286d..f259981f0f2 100644 --- a/llvm/test/Transforms/InstCombine/select-bitext.ll +++ b/llvm/test/Transforms/InstCombine/select-bitext.ll @@ -166,6 +166,17 @@ define <2 x i32> @test_vectors_sext(<2 x i1> %cca, <2 x i1> %ccb) { ret <2 x i32> %r } +define <2 x i32> @test_vectors_sext_nonsplat(<2 x i1> %cca, <2 x i1> %ccb) { +; CHECK-LABEL: @test_vectors_sext_nonsplat( +; CHECK-NEXT: [[CCAX:%.*]] = sext <2 x i1> %cca to <2 x i32> +; CHECK-NEXT: [[R:%.*]] = select <2 x i1> %ccb, <2 x i32> [[CCAX]], <2 x i32> <i32 0, i32 -1> +; CHECK-NEXT: ret <2 x i32> [[R]] +; + %ccax = sext <2 x i1> %cca to <2 x i32> + %r = select <2 x i1> %ccb, <2 x i32> %ccax, <2 x i32> <i32 0, i32 -1> + ret <2 x i32> %r +} + define <2 x i32> @test_vectors_zext(<2 x i1> %cca, <2 x i1> %ccb) { ; CHECK-LABEL: @test_vectors_zext( ; CHECK-NEXT: [[FOLD_R:%.*]] = and <2 x i1> %ccb, %cca @@ -177,6 +188,17 @@ define <2 x i32> @test_vectors_zext(<2 x i1> %cca, <2 x i1> %ccb) { ret <2 x i32> %r } +define <2 x i32> @test_vectors_zext_nonsplat(<2 x i1> %cca, <2 x i1> %ccb) { +; CHECK-LABEL: @test_vectors_zext_nonsplat( +; CHECK-NEXT: [[CCAX:%.*]] = zext <2 x i1> %cca to <2 x i32> +; CHECK-NEXT: [[R:%.*]] = select <2 x i1> %ccb, <2 x i32> [[CCAX]], <2 x i32> <i32 1, i32 0> +; CHECK-NEXT: ret <2 x i32> [[R]] +; + %ccax = zext <2 x i1> %cca to <2 x i32> + %r = select <2 x i1> %ccb, <2 x i32> %ccax, <2 x i32> <i32 1, i32 0> + ret <2 x i32> %r +} + define <2 x i32> @scalar_select_of_vectors_sext(<2 x i1> %cca, i1 %ccb) { ; CHECK-LABEL: @scalar_select_of_vectors_sext( ; CHECK-NEXT: [[FOLD_R:%.*]] = select i1 %ccb, <2 x i1> %cca, <2 x i1> zeroinitializer |