[PATCH] D27787: Restrict some DAGCombines for SHUFFLE_VECTOR nodes.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 14 17:14:05 PST 2016


efriedma created this revision.
efriedma added reviewers: mkuper, craig.topper, RKSimon.
efriedma added subscribers: llvm-commits, rengolin.
efriedma set the repository for this revision to rL LLVM.

Don't combine a shuffle of two BUILD_VECTORs in general. It causes problems in many situations.

Don't try to combine a splat with another shuffle; splats aren't good targets for this optimization because they're often free (so the resulting shuffle might be more expensive, even if it's legal).

Fixes https://llvm.org/bugs/show_bug.cgi?id=31301 .  Fixes https://llvm.org/bugs/show_bug.cgi?id=31364 .

It's possible the change to combineShuffleOfScalars is a little too restrictive... but I'm not sure what a good heuristic would be.


Repository:
  rL LLVM

https://reviews.llvm.org/D27787

Files:
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  test/CodeGen/AArch64/arm64-neon-copy.ll
  test/CodeGen/ARM/vtrn.ll
  test/CodeGen/ARM/vzip.ll
  test/CodeGen/X86/mmx-bitcast.ll
  test/CodeGen/X86/oddshuffles.ll
  test/CodeGen/X86/promote-vec3.ll
  test/CodeGen/X86/vec_insert-5.ll
  test/CodeGen/X86/vec_insert-mmx.ll
  test/CodeGen/X86/vector-shuffle-128-v16.ll
  test/CodeGen/X86/vector-shuffle-128-v8.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27787.81499.patch
Type: text/x-patch
Size: 31557 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161215/b76b46de/attachment.bin>


More information about the llvm-commits mailing list