[Mlir-commits] [mlir] [mlir][bytecode] Add support for deferred attribute/type parsing. (PR #170993)

Billy Zhu llvmlistbot at llvm.org
Wed Dec 17 11:14:44 PST 2025


zyx-billy wrote:

Hi @jpienaar , @joker-eph, I believe this PR is missing the failure retry logic when parsing attributes from a registered op with properties.

Small upstream repro:
```mlir
// repro.mlir
func.func @deeply_nested() -> i32 {
  %0 = "test.constant"() {value = [[[[[[1]]]]]]} : () -> i32
  return %0 : i32
}
```

test command:
```
mlir-opt repro.mlir -emit-bytecode -o repro.mlirbc
mlir-opt repro.mlirbc
```
This last step will fail due to the 6 levels of nesting. But if you remove 2 levels of nesting, it will succeed.

The failure path is:
- parseOpWithoutRegions creates a DialectReader and calls `propertiesReader.read`
- This calls `iface->readProperties`, passing in a `DialectReader`.
- The op's `readProperties` method will call `readAttribute` on the `DialectReader` (instead of the `AttrTypeReader`, which has the failure retry logic), and it will fail if nesting is too high. But nothing is catching this and retrying iteratively.

I haven't yet come up with a quick fix for this. Do you see this as an easy fix? If not, can we consider reverting to not break downstream users. Thanks! (cc @weiweichen, thanks for flagging this).

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


More information about the Mlir-commits mailing list