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

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 4 05:57:15 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.
----------------
david-arm wrote:

OK so if both `ScalableTC==true` and `MainLoopVF.isScalable()==true` then we know `RemainingIterations` must be a multiple of vscale. If we cannot calculate `EstimatedRemIter` because RemainingIterations!=var x vscale then in the new code below we will end up comparing a fixed value with vscale.

When `RemainingIterations` isn't in the form `var x vscale` what does the expression look like? If it's just `RemainingIterations=vscale` then presumably we can support that fairly easily here too?

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


More information about the llvm-commits mailing list