[PATCH] D74218: [ARM] Extra MVE VADDV reduction patterns

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 7 06:29:43 PST 2020


dmgreen created this revision.
dmgreen added reviewers: SjoerdMeijer, samparker, simon_tatham, ostannard.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: LLVM.

We already make use of the VADDV vector reduction instruction for cases where the input and the output start out at the same type. The MVE instruction however will sum into an i32, so if we are summing a v16i8 into an i32, we can still use the same instructions.  In terms of IR, this looks like a sext of a legal type (v16i8) into a very illegal type (v16i32) and a vecreduce.add of that into the result. This means we have to catch the pattern early in a DAG combine, producing a target VADDVs/u node, where the signedness is now important.

This is the first part, handling VADDV and VADDVA. There are also VADDVL/VADDVLA instructions, which are interesting because they sum into a 64bit value. And VMLAV and VMLALV, which are interesting because they also do a multiply of two values. It may look a little odd in places as a result.

This is something that I've had sat around on my computer for a while. On it's own it will probably not do very much, as the vectorizer will not produce this IR. Improving that will be a more complicated job than just these patterns though.


https://reviews.llvm.org/D74218

Files:
  llvm/lib/Target/ARM/ARMISelLowering.cpp
  llvm/lib/Target/ARM/ARMISelLowering.h
  llvm/lib/Target/ARM/ARMInstrMVE.td
  llvm/test/CodeGen/Thumb2/mve-vecreduce-add.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74218.243154.patch
Type: text/x-patch
Size: 17252 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200207/dbf27781/attachment.bin>


More information about the llvm-commits mailing list