[mlir][Interfaces] Add ValueBoundsOpInterface
authorMatthias Springer <me@m-sp.org>
Thu, 6 Apr 2023 00:41:15 +0000 (02:41 +0200)
committerMatthias Springer <me@m-sp.org>
Thu, 6 Apr 2023 00:57:14 +0000 (02:57 +0200)
commit8c885658edf599da277d6d8f2f66bf4cf6f2b934
tree1295b846979136c3589ccb46e584e33da9e3420d
parentff908484554be7f9a6b9e64cb4c1d3a1914e0716
[mlir][Interfaces] Add ValueBoundsOpInterface

Ops can implement this interface to specify lower/upper bounds for their result values and block arguments. Bounds can be specified for:
* Index-type values
* Dimension sizes of shapes values

The bounds are added to a constraint set. Users can query this constraint set to compute bounds wrt. to a user-specified set of values. Only EQ bounds are supported at the moment.

This revision also contains interface implementations for various tensor dialect ops, which illustrates how to implement this interface.

Differential Revision: https://reviews.llvm.org/D145681
19 files changed:
mlir/include/mlir/Dialect/Affine/Transforms/Transforms.h
mlir/include/mlir/Dialect/Tensor/IR/ValueBoundsOpInterfaceImpl.h [new file with mode: 0644]
mlir/include/mlir/InitAllDialects.h
mlir/include/mlir/Interfaces/CMakeLists.txt
mlir/include/mlir/Interfaces/ValueBoundsOpInterface.h [new file with mode: 0644]
mlir/include/mlir/Interfaces/ValueBoundsOpInterface.td [new file with mode: 0644]
mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
mlir/lib/Dialect/Affine/Transforms/ReifyValueBounds.cpp [new file with mode: 0644]
mlir/lib/Dialect/Tensor/IR/CMakeLists.txt
mlir/lib/Dialect/Tensor/IR/ValueBoundsOpInterfaceImpl.cpp [new file with mode: 0644]
mlir/lib/Interfaces/CMakeLists.txt
mlir/lib/Interfaces/ValueBoundsOpInterface.cpp [new file with mode: 0644]
mlir/test/Dialect/Affine/value-bounds-reification.mlir [new file with mode: 0644]
mlir/test/Dialect/Tensor/value-bounds-op-interface-impl.mlir [new file with mode: 0644]
mlir/test/lib/Dialect/Affine/CMakeLists.txt
mlir/test/lib/Dialect/Affine/TestReifyValueBounds.cpp [new file with mode: 0644]
mlir/tools/mlir-opt/mlir-opt.cpp
utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel