[llvm] r282901 - [InstCombine] add tests for non-splat select(ext)
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 30 12:15:41 PDT 2016
Author: spatel
Date: Fri Sep 30 14:15:41 2016
New Revision: 282901
URL: http://llvm.org/viewvc/llvm-project?rev=282901&view=rev
Log:
[InstCombine] add tests for non-splat select(ext)
Modified:
llvm/trunk/test/Transforms/InstCombine/select-bitext.ll
Modified: llvm/trunk/test/Transforms/InstCombine/select-bitext.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/select-bitext.ll?rev=282901&r1=282900&r2=282901&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/select-bitext.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/select-bitext.ll Fri Sep 30 14:15:41 2016
@@ -166,6 +166,17 @@ define <2 x i32> @test_vectors_sext(<2 x
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
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
More information about the llvm-commits
mailing list