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)
commit82111f12fb0d36e329c09022da0f0b48034c6cd3
tree590769a209838a74d0a291747d9a56066830c7f5
parentacfad8025008ae6cfea6174c547fbf48f6193666
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

llvm-svn: 209929
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/Generic/select.ll
llvm/test/CodeGen/X86/vselect.ll