[llvm] [AArch64] Fold interleave of build_vector (PR #214403)

Kamlesh Kumar via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 7 07:29:15 PDT 2026


================
@@ -27727,6 +27727,35 @@ SDValue DAGCombiner::visitCONCAT_VECTORS(SDNode *N) {
 }
 
 SDValue DAGCombiner::visitVECTOR_INTERLEAVE(SDNode *N) {
+  EVT VT = N->getValueType(0);
+  SDValue Op0 = N->getOperand(0);
+
+  // Fold an interleave of fixed-length BUILD_VECTORs by rearranging their
+  // scalar operands directly.
+  if (VT.isFixedLengthVector() && Op0.getOpcode() == ISD::BUILD_VECTOR &&
+      llvm::all_of(N->op_values(), [&](SDValue Op) {
+        return Op.getOpcode() == ISD::BUILD_VECTOR &&
+               Op.getOperand(0).getValueType() ==
+                   Op0.getOperand(0).getValueType();
+      })) {
----------------
kamleshbhalui wrote:

applied the suggesions thanks

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


More information about the llvm-commits mailing list