[Mlir-commits] [mlir] [mlir][bytecode] Fix crashes when reading bytecode with unsupported types (PR #186354)

Mehdi Amini llvmlistbot at llvm.org
Mon Mar 16 04:12:30 PDT 2026


================
@@ -0,0 +1,14 @@
+// RUN: not mlir-opt %s --test-bytecode-roundtrip="test-kind=2" 2>&1 | FileCheck %s
+
+// CHECK: failed to verify 'elementType': VectorElementTypeInterface instance
+// CHECK: failed to read bytecode
+
+// This test verifies that a proper error is emitted (rather than crashing with
+// an assertion) when the type callback replaces a vector element type with one
+// that does not implement VectorElementTypeInterface.
+module {
+  func.func @main() -> () {
+    %cst = arith.constant dense<42> : vector<3xi32>
+    return
----------------
joker-eph wrote:

The `VectorTypeWithScalableDims` variant was also fixed (same `getChecked` change) but has no test coverage. Consider adding a scalable-dims case, e.g. `arith.constant dense<42> : vector<[3]xi32>`.

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


More information about the Mlir-commits mailing list