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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 18 08:43:19 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.
----------------
fhahn wrote:

Thanks, added `This grouping allows invalidating the whole chain, if any link is not a valid partial reduction.`

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


More information about the llvm-commits mailing list