[llvm] [LoopVectorizer] Add support for partial reductions (PR #92418)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 15:01:28 PDT 2024


https://github.com/efriedma-quic commented:

If I'm understanding correctly, a "partial reduction" is just a slightly different way of generating code for a reduction?  Basically, instead of performing the reduction using a number of lanes equal to the vector factor, you combine some of the lanes each iteration.  Usually, this wouldn't really be profitable unless you have a register pressure problem. But in very specific cases, you can use specialized instructions that do horizontal sums, in which case it's extremely profitable.  (This is why the testcase is called "partial-reduced-sdot.ll", I assume.)

It seems a bit weird to me to introduce a new intrinsic that, in the general case, isn't actually a natively supported operation on any target.

https://github.com/llvm/llvm-project/pull/92418


More information about the llvm-commits mailing list