Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mlir] Generate Op builders for Python bindings
Add an ODS-backed generator of default builders. This currently does not support operation with attribute arguments, for which the builder is just ignored. Attribute support will be introduced separately for builders and accessors. Default builders are always generated with the same number of result and operand groups as the ODS specification, i.e. one group per each operand or result. Optional elements accept None but cannot be omitted. Variadic groups accept iterable objects and cannot be replaced with a single object. For some operations, it is possible to infer the result type given the traits, but most traits rely on inline pieces of C++ that we cannot (yet) forward to Python bindings. Since the Ops where the inference is possible (having the `SameOperandAndResultTypes` trait or `TypeMatchesWith` without transform field) are a small minority, they also require the result type to make the builder syntax more consistent. Reviewed By: stellaraccident Differential Revision: https://reviews.llvm.org/D91190
- Loading branch information
Showing
4 changed files
with
266 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.