[DAG] Teach how to turn a build_vector into a shuffle if some of the operands are...
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Fri, 21 Nov 2014 14:32:06 +0000 (14:32 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Fri, 21 Nov 2014 14:32:06 +0000 (14:32 +0000)
commit607099b6972b59c9b786a147655c674299bae4de
treeacd4838f978e3cb52074a21eb8490996113fb098
parentbd357588a106dc7c828c57ad8048e82003d638de
[DAG] Teach how to turn a build_vector into a shuffle if some of the operands are zero.

Before this patch, the DAGCombiner only tried to convert build_vector dag nodes
into shuffles if all operands were either extract_vector_elt or undef.

This patch improves that logic and teaches the DAGCombiner how to deal with
build_vector dag nodes where one or more operands are zero. A build_vector
dag node with some zero operands is turned into a shuffle only if the resulting
shuffle mask is legal for the target.

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