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

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 30 04:52:02 PDT 2025


================
@@ -25397,6 +25429,9 @@ SDValue DAGCombiner::visitCONCAT_VECTORS(SDNode *N) {
     return DAG.getBuildVector(VT, SDLoc(N), Opnds);
   }
 
+  if (SDValue V = combineConcatVectorInterleave(N, DAG))
+    return V;
+
----------------
paulwalker-arm wrote:

Relying on the concat will unnecessarily restrict the combine making it unlikely to fire after type legalisation so I'd rather this be an interleave specific combine without caring about its uses.  Which I think will simplify the code as well?

Doing this in `SelectionDAG::getNode()` sounds reasonable but then the combiner doesn't always create new nodes so having the combine could catch more case. These are multi-result nodes so perhaps just choose the path with the cleanest implementation (I'll guess DAGCombiner will win here).

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


More information about the llvm-commits mailing list