[InstSimplify] add test for select of vector constants; NFC
authorSanjay Patel <spatel@rotateright.com>
Fri, 17 Jan 2020 21:26:24 +0000 (16:26 -0500)
committerSanjay Patel <spatel@rotateright.com>
Fri, 17 Jan 2020 21:39:55 +0000 (16:39 -0500)
llvm/test/Transforms/InstSimplify/select.ll

index 15f2a2e36c68cf8748aa303ee6a355989c3365ed..47a57f80a8630431ac60ffc74bcb21162b991351 100644 (file)
@@ -75,6 +75,15 @@ define <3 x float> @equal_arms_vec_less_undef(<3 x i1> %cond) {
   ret <3 x float> %V
 }
 
+define <3 x float> @equal_arms_vec_more_undef(<3 x i1> %cond) {
+; CHECK-LABEL: @equal_arms_vec_more_undef(
+; CHECK-NEXT:    [[V:%.*]] = select <3 x i1> [[COND:%.*]], <3 x float> <float 4.200000e+01, float undef, float undef>, <3 x float> <float undef, float undef, float 4.300000e+01>
+; CHECK-NEXT:    ret <3 x float> [[V]]
+;
+  %V = select <3 x i1> %cond, <3 x float> <float 42.0, float undef, float undef>, <3 x float> <float undef, float undef, float 43.0>
+  ret <3 x float> %V
+}
+
 define <2 x i8> @vsel_tvec(<2 x i8> %x, <2 x i8> %y) {
 ; CHECK-LABEL: @vsel_tvec(
 ; CHECK-NEXT:    ret <2 x i8> [[X:%.*]]