[PATCH] D56875: [DAGCombiner] narrow vector binop with 2 insert subvector operands

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 17 12:20:06 PST 2019


spatel created this revision.
spatel added reviewers: craig.topper, RKSimon, efriedma.
Herald added a subscriber: mcrosier.

  bo (ins undef, X, Z), (ins undef, Y, Z) --> ins undef, (bo X, Y), Z

This is another step in generic vector narrowing. It's also a step towards more horizontal op formation specifically for x86 (although we still failed to match those in the affected tests).

The scalarization cases are also not optimal (we should be scalarizing those), but it's still an improvement to use a narrower vector op when we know part of the result must be undef because both inputs are undef in some vector lanes.

I think a similar match but checking for a constant operand might help some of the cases in D51553 <https://reviews.llvm.org/D51553>.


https://reviews.llvm.org/D56875

Files:
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  test/CodeGen/X86/avx512-hadd-hsub.ll
  test/CodeGen/X86/scalarize-fp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56875.182372.patch
Type: text/x-patch
Size: 8642 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190117/edb847f2/attachment.bin>


More information about the llvm-commits mailing list