[DAGCombine] Produce better code for constant splats
authorMichael Kuperstein <michael.m.kuperstein@intel.com>
Thu, 22 Jan 2015 12:37:23 +0000 (12:37 +0000)
committerMichael Kuperstein <michael.m.kuperstein@intel.com>
Thu, 22 Jan 2015 12:37:23 +0000 (12:37 +0000)
commit0a979a09aeb53a29edf408551ec5229563a7caf1
treec2327cd90b9e520a65c92efabfc5f809119d4fad
parent75ead67b4ea629221c07589a387b7e7e0c2ab3e4
[DAGCombine] Produce better code for constant splats

This solves PR22276.
Splats of constants would sometimes produce redundant shuffles, sometimes ridiculously so (see the PR for details). Fold these shuffles into BUILD_VECTORs early on instead.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226811 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
test/CodeGen/X86/splat-const.ll [new file with mode: 0644]
test/CodeGen/X86/sse41.ll
test/CodeGen/X86/widen_shuffle-1.ll