[llvm] [LoopVectorize] Perform loop versioning for some early exit loops (PR #120603)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 13 12:28:08 PST 2025


https://github.com/fhahn commented:

> This is something I'll look into - perhaps the worst case for now would be that loop versioning is off by default for AArch64 and would have to be enabled explicitly with a flag. Without digging into this in huge detail, is it possible that if MTE is a problem for this PR, then we also have a problem today in the loop vectoriser when we if-convert loads into unconditional loads based upon the result of `isDereferenceableAndAlignedInLoop` - see `LoopVectorizationLegality::canVectorizeWithIfConvert`. MTE can be used for stack tagging.

IIRC `isDereferenceableAndAlignedInLoop` determines dereferenceability separately from either attributes or known allocation sizes, so it should never return true if we could access out-of-bounds I think. I am not sure how the current uses would cause problems with extensions like MTE, is there any particular issue you are thinking about?

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


More information about the llvm-commits mailing list