[llvm] [LV] Support tail-folded epilogue loops (PR #208764)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 1 08:59:30 PDT 2026


================
@@ -856,6 +856,10 @@ class LoopVectorizationPlanner {
   /// The profitability analysis.
   LoopVectorizationCostModel &CM;
 
+  /// The profitability analysis for epilogue tail-folding.
+  /// Cleared after making cost based decisions.
+  std::unique_ptr<LoopVectorizationCostModel> EpilogueTfCM;
----------------
david-arm wrote:

It feels a bit of a shame that we have to add a special case here for tail-folding. I think if possible it would be nice to always have a pointer to the epilogue cost model even for unpredicated epilogues and use that consistently everywhere when dealing with epilogues. I worry that we're essentially introducing forks in the code base where potential fixes for an unpredicated epilogue cost model and code generation do not get mirrored in the tail-folded case.

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


More information about the llvm-commits mailing list