[llvm] [LV] Update forced epilogue VF options to allow different VFs than main. (PR #190393)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 8 14:44:39 PDT 2026


================
@@ -6793,6 +6800,14 @@ void LoopVectorizationPlanner::plan(ElementCount UserVF, unsigned UserIC) {
       CM.collectInLoopReductions();
       if (CM.selectUserVectorizationFactor(UserVF)) {
         LLVM_DEBUG(dbgs() << "LV: Using user VF " << UserVF << ".\n");
+        ElementCount EpilogueUserVF =
+            ElementCount::getFixed(EpilogueVectorizationForceVF);
+        if (EpilogueUserVF.isVector() &&
+            ElementCount::isKnownLT(EpilogueUserVF, UserVF)) {
+          // Build a separate plan for the forced epilogue VF.
+          CM.collectNonVectorizedAndSetWideningDecisions(EpilogueUserVF);
+          buildVPlansWithVPRecipes(EpilogueUserVF, EpilogueUserVF);
+        }
         buildVPlansWithVPRecipes(UserVF, UserVF);
----------------
fhahn wrote:

Yep

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


More information about the llvm-commits mailing list