[llvm] [SelectionDAG] Legalize non-divisible scalable vector widening (PR #218777)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 03:53:11 PDT 2026


================
@@ -9242,6 +9242,32 @@ SDValue DAGTypeLegalizer::ModifyToType(SDValue InOp, EVT NVT,
   if (InEC.hasKnownScalarFactor(WidenEC))
     return DAG.getExtractSubvector(dl, NVT, InOp, 0);
 
+  if (InVT.isScalableVector()) {
----------------
paulwalker-arm wrote:

```suggestion
  if (NVT.isScalableVector() && InVT.isScalableVector()) {
```
The functionality also works when both types are fixed length, but that might be looking for trouble so I'm happy enough with the scalable vector restriction. We can revisit later to see if there's value in relaxing it.

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


More information about the llvm-commits mailing list