[llvm] [LV] Support scalable interleave groups for factors 3, 5, 6 and 7 (PR #141865)

Min-Yih Hsu via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 3 13:15:29 PDT 2025


================
@@ -4575,6 +4575,13 @@ InstructionCost AArch64TTIImpl::getInterleavedMemoryOpCost(
   if (VecTy->isScalableTy() && !ST->hasSVE())
     return InstructionCost::getInvalid();
 
+  // Scalable VFs will emit vector.de[interleave] intrinsics, and currently we
+  // only have lowering for power-of-2 factors.
+  // TODO: Add lowering for vector.[de]interleave3 intrinsics and support in
+  // InterleavedAccessPass for ld3/st3
+  if (VecTy->isScalableTy() && !isPowerOf2_32(Factor))
+    return InstructionCost::getInvalid();
----------------
mshockwave wrote:

I guess you meant why factors or 5 and 7 _used to_ work fine? I think that's because vectorizer has never asked for interleaving non-power-of-two factors before (until now, ofc)

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


More information about the llvm-commits mailing list