[Mlir-commits] [mlir] [MLIR] Add two-phase region parsing API to OpAsmParser (PR #190545)

Henrich Lauko llvmlistbot at llvm.org
Mon Apr 6 03:40:34 PDT 2026


xlauko wrote:

> Which op in MLIR can this be applied to? Would this allow migrating the loop-like operations of ODS assembly format?

My usecase is `cir.func` where we have a lot of attributes in between signature and body I want to get to ODS form something like:

```
prefix attributes 
@name 
custom<FuncSignature>($func-type, $body)
suffix attributes attr-dict-with-keyword
custom<FuncBody>(ref($body))
```

and similar other operations like globals with initializer regions etc.

Multiple times people broke hand-written printer/parsers this might hopefully get rid of these errors, where I tested this on `cir.func` it gets rid of 500 loc of parsers.

This won't make full ODS support, for function-like operations I believe this can work as implementation for future ODS extension like `function-signature($func-type, $body)` and `function-body($body)`.

For loops I believe this woud require some new syntax to introduce new variables, no idea there how this should lool like.

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


More information about the Mlir-commits mailing list