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

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 13 10:21:17 PDT 2024


================
@@ -2126,10 +2127,39 @@ 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();
----------------
paulwalker-arm wrote:

The following code is complex to the point where I see value in having an early exit for the most common `InterleaveFactor==2` case given that's just `return Builder.CreateIntrinsic(WideVecTy....`.

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


More information about the llvm-commits mailing list