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

via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 8 10:02:48 PDT 2026


================
@@ -4376,6 +4376,13 @@ std::unique_ptr<VPlan> LoopVectorizationPlanner::selectBestEpiloguePlan(
   }
 
   if (EpilogueVectorizationForceVF > 1) {
+    if (EpilogueVectorizationForceVF >=
+        IC * estimateElementCount(MainLoopVF, CM.getVScaleForTuning())) {
----------------
ayalz wrote:

Regarding the equal case: the main loop may leave ICxVF iterations iff requiresScalarEpilog, but in this case the epilog loop is also required to leave a scalar remainder. Hence the VF of the epilog loop must always be strictly smaller than the strip-mine factor of the main loop - ICxVF. Might be worth noting.

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


More information about the llvm-commits mailing list