[PATCH] D40209: [DAGCombiner] eliminate shuffle of insert element

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 18 09:14:52 PST 2017


spatel created this revision.
Herald added a subscriber: mcrosier.

I noticed this pattern in https://reviews.llvm.org/D38316 / https://reviews.llvm.org/D38388. We failed to combine a shuffle that is either repeating a scalar insertion at the same position in a vector or translated to a different element index.

Like the earlier patch, this could be an instcombine too, but since we opted to make this a DAG transform earlier, I've made this one a DAG patch too.

I don't think we need any legality checking because the new insert is identical to the existing insert except that it may have a different constant insertion operand.

The constant insertion test in test/CodeGen/X86/vector-shuffle-combining.ll was the motivation for https://reviews.llvm.org/D38756.


https://reviews.llvm.org/D40209

Files:
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  test/CodeGen/X86/shuffle-of-insert.ll
  test/CodeGen/X86/sse41.ll
  test/CodeGen/X86/vector-shuffle-128-v2.ll
  test/CodeGen/X86/vector-shuffle-combining.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40209.123463.patch
Type: text/x-patch
Size: 19942 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171118/93690b5e/attachment.bin>


More information about the llvm-commits mailing list