[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)
commit84fad3e5c9f75710ad1f43198c6e136e7cdb46b4
tree04d9c0d679cd5d5c911e13c5b9350e472055cdcb
parentfebfd3453ec975887ef2370fa4b9a6a9a6757950
[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

llvm-svn: 226811
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/test/CodeGen/X86/splat-const.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/sse41.ll
llvm/test/CodeGen/X86/widen_shuffle-1.ll