llvm-project/mlir/tools/mlir-linalg-ods-gen
gysit 15757ea80a [mlir][OpDSL] Add `TypeFn` class.
This revision introduces a the `TypeFn` class that similar to the `PrimFn` class contains an extensible set of type conversion functions. Having the same mechanism for both type conversion functions and arithmetic functions improves code consistency. Additionally, having an explicit function class and function name is a prerequisite to specify a conversion or arithmetic function via attribute. In a follow up commits, we will introduce function attributes to make OpDSL operations more generic. In particular, the goal is to handle signed and unsigned computation in one operations. Today, there is a linalg.matmul and a linalg.matmul_unsigned.

The commit implements the following changes:
- Introduce the class of type conversion functions `TypeFn`
- Replace the hardwired cast and cast_unsigned ops by the `TypeFn` counterparts
- Adapt the python and C++ code generation paths to support the new cast operations

Example:
```
cast(U, A[D.m, D.k])
```
changes to
```
TypeFn.cast(U, A[D.m, D.k])
```

Depends On D115237

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D115239
2022-01-07 12:26:47 +00:00
..
CMakeLists.txt [mlir] Remove old "tc" linalg ods generator. 2021-09-30 16:30:06 +00:00
mlir-linalg-ods-yaml-gen.cpp [mlir][OpDSL] Add `TypeFn` class. 2022-01-07 12:26:47 +00:00
update_core_linalg_named_ops.sh.in [mlir][linalg] Add script to update the LinalgNamedStructuredOps.yaml. nfc 2021-08-22 16:54:51 -07:00