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

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 31 03:52:20 PDT 2025


================
@@ -25465,6 +25502,24 @@ SDValue DAGCombiner::visitCONCAT_VECTORS(SDNode *N) {
   return SDValue();
 }
 
+SDValue DAGCombiner::visitVECTOR_INTERLEAVE(SDNode *N) {
+  // Check to see if all operands are identical.
+  if (!llvm::all_equal(N->op_values()))
+    return SDValue();
+
+  // Check to see if the identical operand is a splat.
+  SDValue Op0 = N->getOperand(0);
+  SDValue Splat = DAG.getSplatValue(Op0);
----------------
paulwalker-arm wrote:

```suggestion
  SDValue Splat = DAG.getSplatValue(N->getOperand(0));
```

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


More information about the llvm-commits mailing list