Convert a vselect into a concat_vector if possible
authorFilipe Cabecinhas <me@filcab.net>
Fri, 30 May 2014 23:03:11 +0000 (23:03 +0000)
committerFilipe Cabecinhas <me@filcab.net>
Fri, 30 May 2014 23:03:11 +0000 (23:03 +0000)
commitd99cefbad17a3680601914ff73a28d3214f91c70
tree02b1d477b927c6a726d5915173371a3fed3736f5
parent96241f26fcbf6bc40a4ce1ea6c3c7ef8af22b7a9
Convert a vselect into a concat_vector if possible

Summary:
If both vector args to vselect are concat_vectors and the condition is
constant and picks half a vector from each argument, convert the vselect
into a concat_vectors.

Added a test.

The ConvertSelectToConcatVector is assuming it doesn't get vselects with
arguments of, for example, <undef, undef, true, true>. Those get taken
care of in the checks above its call.

Reviewers: nadav, delena, grosbach, hfinkel

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D3916

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209929 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/Generic/select.ll
test/CodeGen/X86/vselect.ll