[PATCH] D84451: [LV] Tail folded inloop reductions.

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 23 11:10:19 PDT 2020


dmgreen created this revision.
dmgreen added reviewers: Ayal, gilr, fhahn, hsaito, dcaballe.
Herald added subscribers: vkmr, rogfer01, hiraditya.
Herald added a project: LLVM.

This expands upon D75069 <https://reviews.llvm.org/D75069>, allowing them to be inserted into tail folded loops. Reductions are generates with the form:

  x = select(mask, vecop, zero)
  v = vecreduce.add(x)

Where zero here is chosen as the identity value for add reductions. The backend is then expected to fold the select and the vecreduce into a single predicated instruction.

Most of the code is fairly straight forward, except for the creation of blockmasks which need to ensure they are created in dominance order.


https://reviews.llvm.org/D84451

Files:
  llvm/include/llvm/Analysis/IVDescriptors.h
  llvm/lib/Analysis/IVDescriptors.cpp
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/lib/Transforms/Vectorize/VPlan.cpp
  llvm/lib/Transforms/Vectorize/VPlan.h
  llvm/test/Transforms/LoopVectorize/ARM/reduction-inloop-pred.ll
  llvm/test/Transforms/LoopVectorize/X86/optsize.ll
  llvm/test/Transforms/LoopVectorize/X86/tail_loop_folding.ll
  llvm/test/Transforms/LoopVectorize/X86/vect.omp.force.small-tc.ll
  llvm/test/Transforms/LoopVectorize/X86/x86-interleaved-accesses-masked-group.ll
  llvm/test/Transforms/LoopVectorize/optsize.ll
  llvm/test/Transforms/LoopVectorize/reduction-inloop-pred.ll
  llvm/test/Transforms/LoopVectorize/reduction-order.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84451.280175.patch
Type: text/x-patch
Size: 231494 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200723/0b1ea689/attachment-0001.bin>


More information about the llvm-commits mailing list