[llvm] [LV] Use VPReductionRecipe for partial reductions (PR #147513)
Graham Hunter via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 20 09:05:05 PST 2025
================
@@ -2370,6 +2370,23 @@ struct VPFirstOrderRecurrencePHIRecipe : public VPHeaderPHIRecipe {
#endif
};
+// Possible variants of a reduction.
+
+// This reduction is ordered and in-loop.
+struct RdxOrderedInLoop {};
+// This reduction is in-loop.
+struct RdxInLoop {};
+// This reduction isn't partial, ordered or in-loop.
+struct RdxNormal {};
----------------
huntergr-arm wrote:
For a normal reduction, ScaleFactor == 1, so there's no change in VF.
AIUI, @paulwalker-arm 's long-term plan was to unify 'normal', 'partial', and 'in-loop' reductions to always use a partial.reduction intrinsic for the update, since the intrinsic can handle all 3 cases. It's only the ordered case that's different. If the VF is the same then a later pass could exchange it for a normal widened operation for targets which aren't partial-reduction aware.
https://github.com/llvm/llvm-project/pull/147513
More information about the llvm-commits
mailing list