[llvm-branch-commits] [llvm] Patch 3: [LV] Add extra CM instace for EpilogueTF (PR #202820)

Luke Lau via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Jun 14 21:18:47 PDT 2026


================
@@ -5546,12 +5574,17 @@ void LoopVectorizationPlanner::plan(ElementCount UserVF, unsigned UserIC,
              "VF needs to be a power of two");
       // Collect the instructions (and their associated costs) that will be more
       // profitable to scalarize.
-      CM.collectNonVectorizedAndSetWideningDecisions(UserVF);
+      for_each(EnabledCMs, [&](auto *CurrentCM) {
+        CurrentCM->collectNonVectorizedAndSetWideningDecisions(UserVF);
+      });
       ElementCount EpilogueUserVF =
           ElementCount::getFixed(EpilogueVectorizationForceVF);
       if (EpilogueUserVF.isVector() &&
           ElementCount::isKnownLT(EpilogueUserVF, UserVF)) {
-        CM.collectNonVectorizedAndSetWideningDecisions(EpilogueUserVF);
+        for_each(EnabledCMs, [&](auto *CurrentCM) {
+          CurrentCM->collectNonVectorizedAndSetWideningDecisions(
+              EpilogueUserVF);
+        });
----------------
lukel97 wrote:

Do we need to collect the widening decisions for the EpilogueUserVF for the main cost model? Can this just be `EpilogueTailFoldingCM->collectNonVectorizedAndSetWideningDecisions(EpilogueUserVF)`?

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


More information about the llvm-branch-commits mailing list