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

Hassnaa Hamdi via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Jun 15 04:56:52 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);
+        });
----------------
hassnaaHamdi wrote:

No, we don't need it, but I want to keep it as it is to keep the current logic working even if I enabled the new tail-folding policy until I can eventually emit tail-folded epilogue. But I'm also not sure if this thought is correct or not.
I will add a TODO to remove it once we complete the feature. what do you think ?

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


More information about the llvm-branch-commits mailing list