[DAGCombiner] loosen restrictions for moving shuffles after vector binop
authorSanjay Patel <spatel@rotateright.com>
Wed, 3 Apr 2019 13:42:06 +0000 (13:42 +0000)
committerSanjay Patel <spatel@rotateright.com>
Wed, 3 Apr 2019 13:42:06 +0000 (13:42 +0000)
commit00dae6b22d2a573d83b77ca7d805e5c334ac3c30
treee461f63343b50e74535eaf9d7f27be91012169e1
parentf36b2534b23cc762d3e703802e143d04c4a8cd84
[DAGCombiner] loosen restrictions for moving shuffles after vector binop

There are 3 changes to make this correspond to the same transform in instcombine:
1. Remove the legality check - we can't create anything less legal than we started with.
2. Ease the use restriction, so we only bail out if both operands have >1 use.
3. Ease the use restriction for binops with a repeated operand (eg, mul x, x).

As discussed in D60150, there's a scalarization opportunity that will be made
easier by allowing this transform more generally.

llvm-svn: 357580
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AArch64/arm64-vext.ll
llvm/test/CodeGen/ARM/reg_sequence.ll
llvm/test/CodeGen/ARM/vlddup.ll
llvm/test/CodeGen/X86/2012-07-10-extload64.ll
llvm/test/CodeGen/X86/scalarize-fp.ll
llvm/test/CodeGen/X86/trunc-ext-ld-st.ll