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

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 9 07:23:52 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();
-
----------------
david-arm wrote:

Perhaps I'm wrong, but I think @fhahn means a test where we don't specify -force-vector-width=1 and the cost model ends up choosing `vscale x 1` as the best VF?

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


More information about the llvm-commits mailing list