[llvm] [DAGCombiner] Add combine for vector interleave of splats (PR #151110)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 30 03:42:30 PDT 2025


================
@@ -25173,6 +25173,37 @@ static SDValue combineConcatVectorOfCasts(SDNode *N, SelectionDAG &DAG) {
   return DAG.getNode(CastOpcode, DL, VT, NewConcat);
 }
 
+static SDValue combineConcatVectorInterleave(SDNode *N, SelectionDAG &DAG) {
+  SDValue FirstOp = N->getOperand(0);
+  if (FirstOp.getOpcode() != ISD::VECTOR_INTERLEAVE ||
+      FirstOp.getNumOperands() != N->getNumOperands())
+    return SDValue();
+
+  for (unsigned I = 0; I < N->getNumOperands(); I++) {
----------------
lukel97 wrote:

Nit, does enumerating op_values also work here?
```suggestion
  for (auto [Idx, Op] : enumerate(N->op_values())) {
```

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


More information about the llvm-commits mailing list