diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-01-21 02:30:43 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-01-21 02:30:43 +0000 |
commit | 6a083cf820d245c1527ef92c7f92012aee9cc1ec (patch) | |
tree | 78d96ae1cb264b18984a43872859ff457d371250 /llvm/test | |
parent | 0324b67267a7a08e88d9651b3c319df44fd5ae58 (diff) | |
download | bcm5719-llvm-6a083cf820d245c1527ef92c7f92012aee9cc1ec.tar.gz bcm5719-llvm-6a083cf820d245c1527ef92c7f92012aee9cc1ec.zip |
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.
llvm-svn: 123963
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/Transforms/InstCombine/select.ll | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/select.ll b/llvm/test/Transforms/InstCombine/select.ll index 6633564c2b6..54cfc467ccd 100644 --- a/llvm/test/Transforms/InstCombine/select.ll +++ b/llvm/test/Transforms/InstCombine/select.ll @@ -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 +} |