[all-commits] [llvm/llvm-project] 71b6b0: [mlir][python] Factor out standalone OpView._ods_b...
Stella Laurenzo via All-commits
all-commits at lists.llvm.org
Tue Jan 19 09:34:26 PST 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 71b6b010e6bc49caaec511195e33ac1f43f07c64
https://github.com/llvm/llvm-project/commit/71b6b010e6bc49caaec511195e33ac1f43f07c64
Author: Stella Laurenzo <stellaraccident at gmail.com>
Date: 2021-01-19 (Tue, 19 Jan 2021)
Changed paths:
M mlir/docs/Bindings/Python.md
A mlir/examples/python/linalg_matmul.py
M mlir/lib/Bindings/Python/IRModules.cpp
M mlir/lib/Bindings/Python/IRModules.h
A mlir/test/Bindings/Python/ods_helpers.py
M mlir/test/mlir-tblgen/op-python-bindings.td
M mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp
Log Message:
-----------
[mlir][python] Factor out standalone OpView._ods_build_default class method.
* This allows us to hoist trait level information for regions and sized-variadic to class level attributes (_ODS_REGIONS, _ODS_OPERAND_SEGMENTS, _ODS_RESULT_SEGMENTS).
* Eliminates some splicey python generated code in favor of a native helper for it.
* Makes it possible to implement custom, variadic and region based builders with one line of python, without needing to manually code access to the segment attributes.
* Needs follow-on work for region based callbacks and support for SingleBlockImplicitTerminator.
* A follow-up will actually add ODS support for generating custom Python builders that delegate to this new method.
* Also includes the start of an e2e sample for constructing linalg ops where this limitation was discovered (working progressively through this example and cleaning up as I go).
Differential Revision: https://reviews.llvm.org/D94738
More information about the All-commits
mailing list