[X86] In lowerVectorShuffle, instead of creating a new node to canonicalize the shuff...
authorCraig Topper <craig.topper@intel.com>
Tue, 23 Jul 2019 18:46:15 +0000 (18:46 +0000)
committerCraig Topper <craig.topper@intel.com>
Tue, 23 Jul 2019 18:46:15 +0000 (18:46 +0000)
commit76bc3d6e074d6e71cf13b82fa4a76678e67efae9
treeff2606b82ebcbf1357a6c53ef9838fe8f872dcb5
parent374398afb784e2e0f027f9a408eb7640198d8558
[X86] In lowerVectorShuffle, instead of creating a new node to canonicalize the shuffle mask by commuting, just commute the mask and swap V1/V2.

LegalizeDAG tries to legal the DAG by legalizing nodes before
their operands.

If we create a new node, we end up legalizing it after its operands.
This prevents some of the optimizations that can be done when the
operand is a build_vector since the build_vector will have been
legalized to something else.

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

llvm-svn: 366835
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/oddshuffles.ll
llvm/test/CodeGen/X86/vector-shift-ashr-sub128.ll
llvm/test/CodeGen/X86/vector-shuffle-128-v2.ll
llvm/test/CodeGen/X86/vector-zext-widen.ll
llvm/test/CodeGen/X86/vector-zext.ll