[llvm] LV]: consider scalable VF during deciding dead epilogue. (PR #156724)

Hassnaa Hamdi via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 4 05:33:01 PST 2025


================
@@ -4407,6 +4407,13 @@ VectorizationFactor LoopVectorizationPlanner::selectEpilogueVectorizationFactor(
     LLVM_DEBUG(dbgs() << "LEV: Maximum Trip Count for Epilogue: "
                       << MaxTripCount << "\n");
   }
+  // Check if the RemainingIterations is scalable.
----------------
hassnaaHamdi wrote:

Yeah we still need this code.
We need to calculate the `EstimatedRemIter` to compare it against the fixed-width VFs.
Depending on the fact that `ScalableTC==true` and `MainLoopVF.isScalable()==true` doesn't work for cases where SCEV can't get the `KnownMinRemIter` to calculate `EstimatedRemIter`, cases like when the `RemainingIter` is just `vscale`.

I could add a TODO here to simplify this when SCEV can be able to handle scale_based expressions that are not in the standard form of: `var x vscale`

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


More information about the llvm-commits mailing list