[DAGCombine] Preserve shuffles when one of the vector operands is constant
authorZvi Rackover <zvi.rackover@intel.com>
Tue, 25 Oct 2016 12:14:19 +0000 (12:14 +0000)
committerZvi Rackover <zvi.rackover@intel.com>
Tue, 25 Oct 2016 12:14:19 +0000 (12:14 +0000)
commit124470a202d7b7511253762f67913e3acf27fac2
tree3074e05d823fdc8f70bd0fd0ee54796a15189b4e
parent3db70210f813b63455a53c4f0fe439c6e576c448
[DAGCombine] Preserve shuffles when one of the vector operands is constant

Summary:
Do *not* perform combines such as:

    vector_shuffle<4,1,2,3>(build_vector(Ud, C0, C1 C2), scalar_to_vector(X))
    ->
    build_vector(X, C0, C1, C2)

Keeping the shuffle allows lowering the constant build_vector to a materialized
constant vector (such as a vector-load from the constant-pool or some other idiom).

Reviewers: delena, igorb, spatel, mkuper, andreadb, RKSimon

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D25524

llvm-svn: 285063
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/X86/vector-shuffle-combining.ll