Open
Description
Currently there seem to be two ways to register the upstream dialects in a build of MLIR Python:
a) use mlirRegisterEverything
, which works, but links in many dialects and transforms that might not be necessary.
b) define a _site_initialize
module, which works, but requires that you write a custom pybind11 module.
Wouldn't it be nice if one could do neither (a) nor (b), and instead just explicitly register dialects like arith
with a ir.Context
from Python, without having to write a C++ Python extension to do so?
I'm imagining adding an API along the lines of:
arith.register_dialect(context)
to the generated code for a dialect, but I don't much mind exactly what the API is, so long as it exists. That appears to be the pattern often used by out-of-tree dialects.