[llvm] [LV] Ignore user-specified interleave count when unsafe. (PR #153009)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 11 08:46:51 PDT 2025
================
@@ -10138,8 +10138,10 @@ bool LoopVectorizePass::processLoop(Loop *L) {
ElementCount UserVF = Hints.getWidth();
unsigned UserIC = Hints.getInterleave();
+ unsigned SafeUserIC = CM.Legal->isSafeForAnyVectorWidth() ? UserIC : 0;
----------------
fhahn wrote:
I think it would be better to move dealing with UserIC to `selectInterleaveCount`, where you can re-order the checks a bit so we first perform the legality check and otherwise return the UserIC, if provided.
That way we don't have to duplicate the logic here to determine if an interleave count is safe, and don't have to worry about keeping them in sync
https://github.com/llvm/llvm-project/pull/153009
More information about the llvm-commits
mailing list