[PATCH] D66680: [DAGCombiner][X86] Teach SimplifyVBinOp to fold VBinOp (concat X, undef/constant), (concat Y, undef/constant) -> concat (VBinOp X, Y), VecC

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 23 13:31:18 PDT 2019


craig.topper created this revision.
craig.topper added reviewers: spatel, RKSimon.
Herald added subscribers: dmgreen, hiraditya.
Herald added a project: LLVM.

This improves the combine I included in D66504 <https://reviews.llvm.org/D66504> to handle constants in the upper operands of the concat. If we can constant fold them away we can pull the concat after the bin op. This helps with chains of madd reductions on X86 from loop unrolling. The loop madd reduction pattern creates pmaddwd with half the width of the add that follows it using zeroes to fill the upper bits. If we have two of these added together we can pull the zeroes through the accumulating add and then shrink it.


https://reviews.llvm.org/D66680

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/test/CodeGen/X86/madd.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66680.216937.patch
Type: text/x-patch
Size: 5165 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190823/0f368547/attachment-0001.bin>


More information about the llvm-commits mailing list