[llvm] [LV] Don't vectorize epilogue with scalable VF if no iterations remain. (PR #149789)
Paul Walker via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 22 02:53:20 PDT 2025
================
@@ -4479,6 +4479,28 @@ VectorizationFactor LoopVectorizationPlanner::selectEpilogueVectorizationFactor(
Type *TCType = Legal->getWidestInductionType();
const SCEV *RemainingIterations = nullptr;
unsigned MaxTripCount = 0;
+ if (MainLoopVF.isFixed()) {
----------------
paulwalker-arm wrote:
I've a few SCEV patches, one at review and one delayed by https://github.com/llvm/llvm-project/pull/146102 that should fix this.
That said, we should not be unnecessarily restricting things to fixed length vectors. As a minimum I think the `MainLoopVF.isFixed()` check can be move to just prior to the point where `MaxTripCount` is recalculated, with the prior call to `getURemExpr()` using `SE.getElementCount(TCType, MainLoopVF * IC)`.
https://github.com/llvm/llvm-project/pull/149789
More information about the llvm-commits
mailing list