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

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 30 02:12: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;
+
----------------
david-arm wrote:

In that case is it really a DAG combine? It sounds more like a simplification of a node, which might be better done at the time of creation in SelectionDAG::getNode perhaps? It could work, but I'm not sure how to do it because the node still needs to set N results. I see what you mean though - if only the first result gets used then this DAG combine doesn't help. I kind of expected the common use case at the moment is the pattern created by SelectionDAGBuilder when lowering the llvm.vector.interleave intrinsic. @paulwalker-arm any thoughts?

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


More information about the llvm-commits mailing list