[llvm] [LV] Thread an explicit CM param through VPlan-building/costing helpers (PR #224836)
Hassnaa Hamdi via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 23 06:10:02 PDT 2026
================
@@ -896,15 +896,18 @@ class LoopVectorizationPlanner {
/// A builder used to construct the current plan.
VPBuilder Builder;
- /// Computes the cost of \p Plan for vectorization factor \p VF.
+ /// Computes the cost of \p Plan for vectorization factor \p VF, using
+ /// \p EnabledCM as the cost model (the main loop's cost model, or a
+ /// separate one when costing a tail-folded epilogue).
///
/// The current implementation requires access to the
/// LoopVectorizationLegality to handle inductions and reductions, which is
/// why it is kept separate from the VPlan-only cost infrastructure.
///
/// TODO: Move to VPlan::cost once the use of LoopVectorizationLegality has
/// been retired.
- InstructionCost cost(VPlan &Plan, ElementCount VF, VPRegisterUsage *RU) const;
+ InstructionCost cost(VPlan &Plan, ElementCount VF, VPRegisterUsage *RU,
----------------
hassnaaHamdi wrote:
Yes, I think the same but @fhahn suggested that for the current limited version of the epilogue TF, we can go on with this current approach given that the affected functions here are limited -the vplan building functions and cost function-.
https://github.com/llvm/llvm-project/pull/224836
More information about the llvm-commits
mailing list