Effectively, this patch makes it possible to reference
MLIRPythonSources.Dialects.affine when adding a dependency on the
affine dialect.
Details
- Reviewers
stellaraccident ftynse shabalin dcaballe
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I would prefer us to land op API customizations either in this patch, or very soon after. Generated API for affine ops will be quite raw and low-level, and we will likely grow uses for which the API will be broken when we land the improvements. Look at how SCF loops are supported in https://github.com/llvm/llvm-project/blob/main/mlir/python/mlir/dialects/_scf_ops_ext.py#L13. Also, load/store with non-trivial maps may get nasty and deserve some API work.
mlir/test/python/dialects/affine_dialect.py | ||
---|---|---|
17–24 | It is preferable to create this structure programmatically than to rely on parsing string IR. API updates are mechanical, embedded string updates -- not so much. |
Note that it is possible to construct operations from any registered dialect using the generic Operation.create which is barely more verbose than the generated APIs in this case.
Apologies for the much delayed response. I'm abandoning this revision since I found a workaround, but I will come back to this with a proper fix later.
It is preferable to create this structure programmatically than to rely on parsing string IR. API updates are mechanical, embedded string updates -- not so much.