[llvm] [AArch64][SelectionDAG] Fold SVE interleaves of splat vectors (PR #219146)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 08:49:16 PDT 2026


https://github.com/MacDue requested changes to this pull request.

If you're simply interested in fixing a crash I'd make more sense to fix the concat_vectors legalization. I think for scalable vectors we could do something lilke:

```
  if (VT.isScalableVector()) {
    SDValue Result = DAG.getPOISON(VT);
    for (unsigned i=0; i < NumOperands; ++i) {
      SDValue InOp = N->getOperand(i);
      assert(getTypeAction(InOp.getValueType()) ==
                TargetLowering::TypeWidenVector &&
            "Unexpected type action");
      InOp = GetWidenedVector(InOp);

      InOp = DAG.getExtractSubvector(dl, InVT, InOp, 0);
      Result = DAG.getInsertSubvector(dl, Result, InOp,
        i * InVT.getVectorMinNumElements());
    }
    return Result;
  }
```
(not tested).

Actually optimizing this case is not that important unless (it's unlikely anyone is using these types). 

Note: The current patch appears to be a regression for the `interleave2_nxv4f32` case. https://godbolt.org/z/bYPqGjGxx




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


More information about the llvm-commits mailing list