[mlir][Python][Linalg] Adding const, capture, and index support to the OpDSL.
authorTobias Gysi <gysit@google.com>
Thu, 29 Apr 2021 06:45:34 +0000 (06:45 +0000)
committerTobias Gysi <gysit@google.com>
Thu, 29 Apr 2021 07:24:47 +0000 (07:24 +0000)
commitc2be2cda8d268d4a0adbede149a20e3fd284f1d7
tree3a4a257d94d525392daddf04508b9a2251c43a1b
parent9363aa90bfe6f73df105799abc55bb74d4f186bf
[mlir][Python][Linalg] Adding const, capture, and index support to the OpDSL.

The patch extends the OpDSL with support for:
- Constant values
- Capture scalar parameters
- Access the iteration indices using the index operation
- Provide predefined floating point and integer types.

Up to now the patch only supports emitting the new nodes. The C++/yaml path is not fully implemented. The fill_rng_2d operation defined in emit_structured_generic.py makes use of the new DSL constructs.

Differential Revision: https://reviews.llvm.org/D101364
mlir/docs/Tools/LinalgOpDsl.md
mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/affine.py
mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/comprehension.py
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
mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/scalar_expr.py
mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/types.py
mlir/test/Bindings/Python/dialects/linalg/opdsl/emit_structured_generic.py