[llvm] [LV]: Teach LV to recursively (de)interleave. (PR #89018)

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 11 02:14:59 PST 2024


================
@@ -2779,10 +2779,21 @@ static Value *interleaveVectors(IRBuilderBase &Builder, ArrayRef<Value *> Vals,
   // Scalable vectors cannot use arbitrary shufflevectors (only splats), so
   // must use intrinsics to interleave.
   if (VecTy->isScalableTy()) {
-    VectorType *WideVecTy = VectorType::getDoubleElementsVectorType(VecTy);
-    return Builder.CreateIntrinsic(WideVecTy, Intrinsic::vector_interleave2,
-                                   Vals,
-                                   /*FMFSource=*/nullptr, Name);
+    unsigned InterleaveFactor = Vals.size();
+    SmallVector<Value *> InterleavingValues(Vals);
+    // When interleaving, the number of values will be shrunk until we have the
+    // single final interleaved value.
+    VectorType *InterleaveTy =
----------------
Mel-Chen wrote:

nit
```suggestion
    auto *InterleaveTy =
```

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


More information about the llvm-commits mailing list