[mlir][linalg] Add structured op builders from python opdsl.
authorStella Laurenzo <stellaraccident@gmail.com>
Wed, 17 Mar 2021 01:05:19 +0000 (18:05 -0700)
committerStella Laurenzo <stellaraccident@gmail.com>
Fri, 19 Mar 2021 18:20:36 +0000 (11:20 -0700)
commitd4cba4a188f419d1c2fc4b827c4a6a0310b0568e
tree8f1ea3ea5713a7336f3e6cc9b1eeecc4b9e6cc76
parent6c1ae8f2dc374a532f6345d776082eb5b9aaa247
[mlir][linalg] Add structured op builders from python opdsl.

* Makes the wrapped functions of the `@linalg_structured_op` decorator callable such that they emit IR imperatively when invoked.
* There are numerous TODOs that I will keep working through to achieve generality.
* Will true up exception handling tests as the feature progresses (for things that are actually errors once everything is implemented).
* Includes the addition of an `isinstance` method on concrete types in the Python API.

Differential Revision: https://reviews.llvm.org/D98754
mlir/lib/Bindings/Python/IRModules.cpp
mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/config.py
mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/dsl.py
mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/emitter.py [new file with mode: 0644]
mlir/test/Bindings/Python/dialects/linalg/opdsl/emit_structured_generic.py [new file with mode: 0644]
mlir/test/Bindings/Python/ir_types.py