Skip to content

Commit 6d05db1

Browse files
committed
docs
1 parent f989905 commit 6d05db1

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

mlir/test/lib/Dialect/Test/TestOps.td

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2786,6 +2786,16 @@ def InferIntRangeType : AnyTypeOf<[AnyInteger, Index, VectorOf<[AnyInteger, Inde
27862786
def TestWithBoundsOp : TEST_Op<"with_bounds",
27872787
[DeclareOpInterfaceMethods<InferIntRangeInterface, ["inferResultRanges"]>,
27882788
NoMemoryEffect]> {
2789+
let description = [{
2790+
Creates a value with specified [min, max] range for integer range analysis.
2791+
2792+
Example:
2793+
2794+
```mlir
2795+
%0 = test.with_bounds { umin = 4 : index, umax = 5 : index, smin = 4 : index, smax = 5 : index } : index
2796+
```
2797+
}];
2798+
27892799
let arguments = (ins APIntAttr:$umin,
27902800
APIntAttr:$umax,
27912801
APIntAttr:$smin,
@@ -2819,6 +2829,18 @@ def TestIncrementOp : TEST_Op<"increment",
28192829
def TestReflectBoundsOp : TEST_Op<"reflect_bounds",
28202830
[DeclareOpInterfaceMethods<InferIntRangeInterface, ["inferResultRanges"]>,
28212831
AllTypesMatch<["value", "result"]>]> {
2832+
let description = [{
2833+
Integer range analysis will update this op to reflect inferred integer range
2834+
of the input, so it can be checked with FileCheck
2835+
2836+
Example:
2837+
2838+
```mlir
2839+
CHECK: test.reflect_bounds {smax = 7 : index, smin = 0 : index, umax = 7 : index, umin = 0 : index}
2840+
%1 = test.reflect_bounds %0 : index
2841+
```
2842+
}];
2843+
28222844
let arguments = (ins InferIntRangeType:$value,
28232845
OptionalAttr<APIntAttr>:$umin,
28242846
OptionalAttr<APIntAttr>:$umax,

0 commit comments

Comments
 (0)