[Mlir-commits] [mlir] [mlir][python] allow upstream dialect registration (PR #74252)

Stella Laurenzo llvmlistbot at llvm.org
Wed Dec 20 13:03:44 PST 2023


stellaraccident wrote:

This part of the system was, frankly, never finished. Every stakeholder wanted something else and the desire to not end up in a linking-the-world-required state in the upstream world made this hard.

I think the solution may be relatively simple: Treat "RegisterEverything" as something that everyone will want one of -- but make it so that everyone can have their own. Right now "RegisterEverything" is hard coded to be literally all upstream dialects, but what if there was just an easy way to, given a list of dialects, generate the registration handles and statically populate the name->handle map. Then upstream uses that rule to make its "RegisterEverything". Downstreams generate their own C code for that using the same generator, etc. I'd much prefer one C implementation file that needed to be generated for a list of dialects vs the current state that it trends to where there are tons of little pieces that have to fit together.

If we had that, it could replace the ad-hoc _site_initialize stuff for most users, and the way upstream does it would be the same as downstreams. Could ultimately be one CMake target to generate the `RegisterEverything.c`.

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


More information about the Mlir-commits mailing list