xref: /llvm-project/mlir/include/mlir/Interfaces/ValueBoundsOpInterface.td (revision 8c885658edf599da277d6d8f2f66bf4cf6f2b934)
1//===-- ValueBoundsOpInterface.td - Value Bounds -----------*- tablegen -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef VALUEBOUNDSOPINTERFACE
10#define VALUEBOUNDSOPINTERFACE
11
12include "mlir/IR/OpBase.td"
13
14def ValueBoundsOpInterface : OpInterface<"ValueBoundsOpInterface"> {
15  let description = [{
16    This interface allows operations with index-typed and/or shaped value-typed
17    results/block arguments to specify range bounds. These bounds are stored in
18    a constraint set. The constraint set can then be queried to compute bounds
19    in terms of other values that are stored in the constraint set.
20  }];
21  let cppNamespace = "::mlir";
22  let methods = [
23    InterfaceMethod<
24      /*desc=*/[{
25        Populate the constraint set with bounds for the given index-typed
26        value.
27
28        Note: If `value` is a block argument, it must belong to an entry block
29        of a region. Unstructured control flow graphs are not supported at the
30        moment.
31      }],
32      /*retType=*/"void",
33      /*methodName=*/"populateBoundsForIndexValue",
34      /*args=*/(ins "::mlir::Value":$value,
35                    "::mlir::ValueBoundsConstraintSet &":$cstr),
36      /*methodBody=*/"",
37      /*defaultImplementation=*/[{
38        llvm_unreachable("not implemented");
39      }]
40    >,
41    InterfaceMethod<
42      /*desc=*/[{
43        Populate the constraint set with bounds for the size of the specified
44        dimension of the given shaped value.
45
46        Note: If `value` is a block argument, it must belong to an entry block
47        of a region. Unstructured control flow graphs are not supported at the
48        moment.
49      }],
50      /*retType=*/"void",
51      /*methodName=*/"populateBoundsForShapedValueDim",
52      /*args=*/(ins "::mlir::Value":$value,
53                    "int64_t":$dim,
54                    "::mlir::ValueBoundsConstraintSet &":$cstr),
55      /*methodBody=*/"",
56      /*defaultImplementation=*/[{
57        llvm_unreachable("not implemented");
58      }]
59    >,
60  ];
61}
62
63#endif  // VALUEBOUNDSOPINTERFACE
64