[Mlir-commits] [mlir] [mlir][python] automatically bundle builtin dialect with core sources (PR #72338)

Mike Urbach llvmlistbot at llvm.org
Tue Nov 14 20:46:27 PST 2023


mikeurbach wrote:

> And of course, a third (fourth?) option is just to document that you need to add MLIRPythonSources.Dialects.builtin to your DECLARED_SOURCES under add_mlir_python_modules as @mikeurbach did.

This is fine by me. I want the automatic casting for builtin types and attributes to the concrete subclass, that's a pareto improvement IMHO for any op whose Python bindings return builtin types or attributes. It feels a little weird that you have to depend on the builtin dialect's generated Python file for this to work, since the `register_dialect` call in there doesn't do anything; the builtin dialect is already registered. That's why I previously suggested just letting loadDialectModule immediately return true for the builtin dialect. But I don't have a very strong opinion here, if the change we just made in CIRCT is what is recommended, that's fine by me.

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


More information about the Mlir-commits mailing list