[llvm] [LV] Prefer fixed VFs for epilogue vectorization (PR #211814)
Benjamin Maxwell via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 31 06:48:23 PDT 2026
================
@@ -706,6 +706,21 @@ bool LoopVectorizationPlanner::isMoreProfitable(const VectorizationFactor &A,
!B.Width.isScalar())
return true;
+ // Prefer fixed VFs for epilogue loops (unless the fixed cost is much more
+ // expensive -- >= 2x). There are some extra costs for using scalable vectors
+ // in epilogues (e.g., reduced post-vectorization unrolling) that are not
+ // represented in the cost. TODO: Reconsider this restriction for predicated
+ // epilogues (once supported).
+ if (IsEpilogue && A.Width.isScalable() != B.Width.isScalable() &&
----------------
MacDue wrote:
How should this be handled with https://github.com/llvm/llvm-project/pull/211814#discussion_r3655857754? As `preferFixedOverScalableIfEqualCost` then could be reachable again for other cost kinds.
https://github.com/llvm/llvm-project/pull/211814
More information about the llvm-commits
mailing list