[llvm-branch-commits] [llvm] Patch 5: [LV] create predicated(tail-folded) vplans. (PR #207815)

Sander de Smalen via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Jul 16 06:27:18 PDT 2026


================
@@ -5521,9 +5523,9 @@ void LoopVectorizationPlanner::plan(
   // for later use by the cost model.
   Config.computeMinimalBitwidths();
 
-  SmallVector<LoopVectorizationCostModel *, 2> EnabledCMs;
-  EnabledCMs.push_back(&CM);
-
+  SmallVector<std::pair<LoopVectorizationCostModel *, VPlanPtr>, 2> EnabledCMs;
----------------
sdesmalen-arm wrote:

I don't like the idea of keeping track of two duplicate CostModels/Plans here in this function. It would actually be a lot simpler to call `plan()` twice, once with the default cost model, and once with the tail-folding cost-model (if present). Then this function hardly needs any changes.

The only change it would need would be for the function to take a `bool ForceTailFoldedPlans` flag that simply returns if `computeMaxVF()` disabled tail folding.

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


More information about the llvm-branch-commits mailing list