[llvm] [LV] Don't vectorize epilogue with scalable VF if no iterations remain. (PR #149789)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 21 06:26:08 PDT 2025


================
@@ -4479,6 +4479,27 @@ VectorizationFactor LoopVectorizationPlanner::selectEpilogueVectorizationFactor(
   Type *TCType = Legal->getWidestInductionType();
   const SCEV *RemainingIterations = nullptr;
   unsigned MaxTripCount = 0;
+  if (MainLoopVF.isFixed()) {
----------------
david-arm wrote:

I actually wasn't thinking about performance - I was trying to say that this patch may only be a partial fix, i.e. in the example I mentioned the remaining iterations is known to be zero and so won't we hit the same assert?

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


More information about the llvm-commits mailing list