[llvm] [RISCV] Decompose locally repeating shuffles (without exact VLEN) (PR #125735)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 4 11:16:56 PST 2025


================
@@ -5685,10 +5700,42 @@ static SDValue lowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG,
                                  : DAG.getUNDEF(XLenVT));
     }
     SDValue LHSIndices = DAG.getBuildVector(IndexVT, DL, GatherIndicesLHS);
-    LHSIndices = convertToScalableVector(IndexContainerVT, LHSIndices, DAG,
-                                         Subtarget);
-    SDValue Gather = DAG.getNode(GatherVVOpc, DL, ContainerVT, V1, LHSIndices,
-                                 DAG.getUNDEF(ContainerVT), TrueMask, VL);
+    LHSIndices =
+        convertToScalableVector(IndexContainerVT, LHSIndices, DAG, Subtarget);
+
+    SDValue Gather;
+    // If we have a locally repeating mask, then we can reuse the first register
+    // in the index register group for all registers within the source register
+    // group.  TODO:: This generalizes to m2, and m4.  Also, this is currently
----------------
topperc wrote:

extra colon after TODO

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


More information about the llvm-commits mailing list