[llvm] [LV] Always try to use fixed VF for low TC loops if no epilogue allowed. (PR #226318)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 25 01:13:58 PDT 2026


================
@@ -7813,8 +7812,12 @@ bool LoopVectorizePass::processLoop(Loop *L) {
       // `CM_EpilogueNotAllowedLowTripLoop` prevents vectorizing loops
       // with runtime checks. It's more effective to let
       // `isOutsideLoopWorkProfitable` determine if vectorization is
-      // beneficial for the loop.
-      if (SEL != CM_EpilogueNotNeededFoldTail)
+      // beneficial for the loop. If the trip count is below the target's
+      // minimum for tail-folding, the tail cannot be folded, so treat it like
+      // any other low trip count loop.
+      if (SEL != CM_EpilogueNotNeededFoldTail ||
----------------
david-arm wrote:

It looks like there are two independent changes in this PR. Two tests seem to have changed - which test change corresponds to which code change? It's not immediately obvious.

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


More information about the llvm-commits mailing list