Don't try to pull vector bitcasts that change the number of elements through
[oota-llvm.git] / test / Transforms / InstCombine / select.ll
index 6633564c2b6b76bb7f8019cdea72ff2de5949b8a..54cfc467ccdd520cca5013df51c7c8a4c11b47a7 100644 (file)
@@ -689,3 +689,14 @@ define i64 @test50(i32 %a) nounwind {
 ; CHECK-NEXT: %min = select i1 %is_a_nonpositive, i64 %a_ext, i64 2
 ; CHECK-NEXT: ret i64 %min
 }
+
+; PR8994
+
+; Theis select instruction can't be eliminated because trying to do so would
+; change the number of vector elements. This used to assert.
+define i48 @test51(<3 x i1> %icmp, <3 x i16> %tmp) {
+  %select = select <3 x i1> %icmp, <3 x i16> zeroinitializer, <3 x i16> %tmp
+; CHECK: select <3 x i1>
+  %tmp2 = bitcast <3 x i16> %select to i48
+  ret i48 %tmp2
+}