[llvm] [LV] Check full partial reduction chains in order. (PR #168036)

Sam Tebbs via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 18 07:19:12 PST 2025


================
@@ -7980,22 +7975,23 @@ VPReplicateRecipe *VPRecipeBuilder::handleReplication(VPInstruction *VPI,
 /// Find all possible partial reductions in the loop and track all of those that
 /// are valid so recipes can be formed later.
 void VPRecipeBuilder::collectScaledReductions(VFRange &Range) {
-  // Find all possible partial reductions.
-  SmallVector<std::pair<PartialReductionChain, unsigned>>
-      PartialReductionChains;
-  for (const auto &[Phi, RdxDesc] : Legal->getReductionVars()) {
+  // Find all possible partial reductions, grouping chains by their PHI.
----------------
SamTebbs33 wrote:

A comment about why we have to group them by the phi, would be useful.

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


More information about the llvm-commits mailing list