[mlir][linalg] Add unsigned min/max/cast function to OpDSL.
authorTobias Gysi <gysit@google.com>
Thu, 7 Oct 2021 06:26:38 +0000 (06:26 +0000)
committerTobias Gysi <gysit@google.com>
Thu, 7 Oct 2021 06:27:20 +0000 (06:27 +0000)
commit3fe7fe44249b0c640031a09800f3485a06a61d2d
tree9aa3abc1bad0fbe9b018d538a16ed8c1a9081ec6
parent06404d5488ea505b00f711393973db3ae32d01e9
[mlir][linalg] Add unsigned min/max/cast function to OpDSL.

Update OpDSL to support unsigned integers by adding unsigned min/max/cast signatures. Add tests in OpDSL and on the C++ side to verify the proper signed and unsigned operations are emitted.

The patch addresses an issue brought up in https://reviews.llvm.org/D111170.

Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D111230
mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
mlir/python/mlir/dialects/linalg/opdsl/lang/comprehension.py
mlir/python/mlir/dialects/linalg/opdsl/lang/emitter.py
mlir/python/mlir/dialects/linalg/opdsl/lang/scalar_expr.py
mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py
mlir/test/Dialect/Linalg/generalize-named-polymorphic-ops.mlir
mlir/test/mlir-linalg-ods-gen/test-linalg-ods-yaml-gen.yaml
mlir/test/python/dialects/linalg/opdsl/emit_structured_generic.py
mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp