[llvm] [LV] codegen for tail-folded epilogue loop (PR #208764)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 23:17:26 PDT 2026


================
@@ -5788,7 +5846,7 @@ LoopVectorizationPlanner::precomputeCosts(VPlan &Plan, ElementCount VF,
 
 InstructionCost LoopVectorizationPlanner::cost(VPlan &Plan, ElementCount VF,
                                                VPRegisterUsage *RU) const {
-  VPCostContext CostCtx(*TLI, Plan, CM, Config,
+  VPCostContext CostCtx(*TLI, Plan, *EnabledCM, Config,
----------------
fhahn wrote:

It looks like all existing tests pass if I replace `EnabledCM` with `DefaultCM`, except in `::plan` the functions it calls. 

As I mentioned previously, I don't think some of the updated places require the enabled cost model, at least for the forced-VF version. If it is needed, it would be great if you could add test coverage.

Ideally we would only need the extra cost model during construction.

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


More information about the llvm-commits mailing list