[Mlir-commits] [mlir] [mlir][CAPI] Add C API for creating dynamic dialects, ops, types, and attrs (PR #187239)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Mar 18 23:17:21 PDT 2026


PragmaTwice wrote:

I'm fine with adding more CAPIs about `DynamicDialect` (I'm who added the initial C APIs about `DynamicDialect` previously), just to clarify some points in PR description, before reviewing.

> Previously there was no way to create a DynamicDialect, register dynamic ops/types/attrs, or obtain a MlirDialect handle from C code.

This is not true. You can create and register a DynamicDialect into MLIR context via the IRDL dialect. This is how Python-defined dialects in MLIR Python bindings works. You can check [`mlir.dialects.ext`](https://github.com/llvm/llvm-project/blob/main/mlir/python/mlir/dialects/ext.py) module and [its test case](https://github.com/llvm/llvm-project/blob/main/mlir/test/python/dialects/ext.py) about this.




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


More information about the Mlir-commits mailing list