[llvm] [LoopVectorizer] Add support for partial reductions (PR #92418)
Paul Walker via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 5 08:28:48 PDT 2024
paulwalker-arm wrote:
Given @huntergr-arm's detailed review I'm going to hold off for now but will offer the following suggestion.
The introduction of partial reduction intrinsics can be done independently to the introduction of partial reductions whose second operand is different to the first. At its core my hope is for partial reductions to become the canonical way to break a reduction in two as done by LoopVectorize. The default selection for same size operands is the plain binop LoopVectorize would emit anyway and so it should be pretty safe to implement this change first. Whilst today only ADD operations have a dedicated intrinsic I'm still hopeful this patch can cover all reductions by just emitting an ordinary instruction for those other than ADD.
Once LoopVectorize supports the simplest form of partial reduction we can then extend the support to allow larger VFs for the second operand (or more accurately, to allow the reduction PHI to have a smaller VF than that used to vectorise the loop).
https://github.com/llvm/llvm-project/pull/92418
More information about the llvm-commits
mailing list