[llvm] [LoopVectorize] Vectorize fixed-order recurrence with vscale x 1. (PR #142772)

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 10 07:22:57 PDT 2025


================
@@ -3838,9 +3838,6 @@ VPFirstOrderRecurrencePHIRecipe::computeCost(ElementCount VF,
   if (VF.isScalar())
     return Ctx.TTI.getCFInstrCost(Instruction::PHI, Ctx.CostKind);
 
-  if (VF.isScalable() && VF.getKnownMinValue() == 1)
-    return InstructionCost::getInvalid();
-
----------------
Mel-Chen wrote:

I tried it, but without specifying VF, the current upstream RISC-V cost model will select vscale x 2 for this case. 
So do we still need this patch? Should I close the PR?

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


More information about the llvm-commits mailing list