[Mlir-commits] [mlir] [mlir] Fix mem2reg crash on scalable vector store/load with matching type (PR #209426)

Tobias Gysi llvmlistbot at llvm.org
Tue Jul 14 06:08:19 PDT 2026


================
@@ -256,6 +256,12 @@ static Value createExtractAndCast(OpBuilder &builder, Location loc,
                                  /*narrowingConversion=*/true) &&
          "expected that the compatibility was checked before");
 
+  // Nothing has to be done if the types are already the same. This also
+  // avoids querying the bit size of types that may not have one, such as
+  // scalable vectors.
----------------
gysit wrote:

```suggestion
  // Nothing has to be done if the types are already the same. This also
  // avoids querying the bit size of scalable vector types below.
```
nit: it is fine to query the type size of scalable vectors (the implicit cast of the return value is the issue).

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


More information about the Mlir-commits mailing list