[llvm] [LV] Use VPReductionRecipe for partial reductions (PR #144908)

Sam Tebbs via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 24 02:52:26 PDT 2025


================
@@ -564,8 +564,9 @@ SmallVector<VPRegisterUsage, 8> llvm::calculateRegisterUsageForPlan(
         } else {
           // The output from scaled phis and scaled reductions actually has
           // fewer lanes than the VF.
-          unsigned ScaleFactor = getVFScaleFactor(R);
-          ElementCount VF = VFs[J].divideCoefficientBy(ScaleFactor);
+          ElementCount VF = VFs[J];
+          if (unsigned ScaleFactor = getVFScaleFactor(R); ScaleFactor > 1)
+            VF = VF.divideCoefficientBy(ScaleFactor);
----------------
SamTebbs33 wrote:

Done.

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


More information about the llvm-commits mailing list