Don't try to pull vector bitcasts that change the number of elements through

a select. A vector select is pairwise on each element so we'd need a new
condition with the right number of elements to select on. Fixes PR8994.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123963 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Lewycky
2011-01-21 02:30:43 +00:00
parent 7acdb4d237
commit acf4a7c0e6
2 changed files with 28 additions and 3 deletions

View 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
}