[PATCH] D106532: [ARM] Attempt to distribute reductions

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 22 02:16:11 PDT 2021


dmgreen created this revision.
dmgreen added reviewers: samtebbs, SjoerdMeijer, NickGuy, ostannard, simon_tatham.
Herald added subscribers: danielkiss, hiraditya, kristof.beyls.
dmgreen requested review of this revision.
Herald added a project: LLVM.

This adds a combine for adds of reductions, distributing them so that they occur sequentially to enable better use of accumulating VADDVA instructions. It combines:

  add(X, add(vecreduce(Y), vecreduce(Z))) -> add(add(X, vecreduce(Y)), vecreduce(Z))

and

  add(add(A, reduce(B)), add(C, reduce(D))) -> add(add(add(A, C), reduce(B)), reduce(D))

These together distribute the add's so that more reductions can be selected to VADDVA.


https://reviews.llvm.org/D106532

Files:
  llvm/lib/Target/ARM/ARMISelLowering.cpp
  llvm/test/CodeGen/Thumb2/mve-vaddv.ll
  llvm/test/CodeGen/Thumb2/mve-vecreduce-slp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106532.360736.patch
Type: text/x-patch
Size: 33279 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210722/12221045/attachment.bin>


More information about the llvm-commits mailing list