================ @@ -5026,10 +5026,23 @@ calculateRegisterUsage(VPlan &Plan, ArrayRef<ElementCount> VFs, // even in the scalar case. RegUsage[ClassID] += 1; } else { + // The output from scaled phis and scaled reductions actually have + // fewer lanes than the VF. + auto VF = VFs[J]; + if (auto *ReductionR = dyn_cast<VPReductionPHIRecipe>(R)) + VF = VF.divideCoefficientBy(ReductionR->getVFScaleFactor()); + else if (auto *PartialReductionR = + dyn_cast<VPPartialReductionRecipe>(R)) + VF = VF.divideCoefficientBy(PartialReductionR->getScaleFactor()); + if (VF != VFs[J]) ---------------- NickGuy-Arm wrote:
Nit: If the condition is only used for debug output then can it be moved to inside the LLVM_DEBUG https://github.com/llvm/llvm-project/pull/133090 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits