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

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 11 08:57:36 PDT 2025


================
@@ -240,6 +240,48 @@ Intrinsic::ID llvm::getVectorIntrinsicIDForCall(const CallInst *CI,
   return Intrinsic::not_intrinsic;
 }
 
+Intrinsic::ID llvm::getInterleaveIntrinsicID(unsigned Factor) {
+  switch (Factor) {
+  case 2:
+    return Intrinsic::vector_interleave2;
----------------
david-arm wrote:

Is it worth having a small static table that combines the interleave and deinterleave intrinsics together, i.e.

```
static Intrinsic::ID[][] = {
  {0, 0},
  {0, 0},
  {Intrinsic::vector_interleave2, Intrinsic::vector_deinterleave2},
  ...
} InterleaveFactors;
```

then just indexing the array?

```
Intrinsic::ID llvm::getInterleaveIntrinsicID(unsigned Factor) {
  Intrinsic::ID ID = InterleaveFactors[Factor][0];
  assert(ID && "Invalid factor")
  return ID;
}

Intrinsic::ID llvm::getDeinterleaveIntrinsicID(unsigned Factor) {
  Intrinsic::ID ID = InterleaveFactors[Factor][1];
  assert(ID && "Invalid factor")
  return ID;
}
```

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


More information about the llvm-commits mailing list