[llvm] [IR] Add llvm.vector.[de]interleave{4,6,8} (PR #139893)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Thu May 15 02:59:43 PDT 2025


lukel97 wrote:

> > By representing these higher factors are interleaved-interleaves, we can in theory support arbitrarily high interleave factors. However I'm not sure this is actually needed in practice.
> 
> You can definitely end up with very large interleave factors in some cases; my team has internal testcases for stride 24. Granted, it's uncommon.

>From my understanding though the loop vectorizer upstream today doesn't emit any scalable interleave group higher than 4 on AArch64 and X86 and 8 on RISC-V. This is from a quick grep of `TLI.getMaxSupportedInterleaveFactor`/`getInterleavedMemoryOpCost` and how `BasicTTIImpl::getInterleavedMemoryOpCost` returns invalid for scalable vector types . Do you have anything downstream that works around this limitation?

I should mention that the fixed-length VF VPlan should still be able to handle arbitrarily high factors, and hopefully in these cases the loop vectorizer will pick it based off the cost.

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


More information about the llvm-commits mailing list