@@ -2786,6 +2786,16 @@ def InferIntRangeType : AnyTypeOf<[AnyInteger, Index, VectorOf<[AnyInteger, Inde
2786
2786
def TestWithBoundsOp : TEST_Op<"with_bounds",
2787
2787
[DeclareOpInterfaceMethods<InferIntRangeInterface, ["inferResultRanges"]>,
2788
2788
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
+
2789
2799
let arguments = (ins APIntAttr:$umin,
2790
2800
APIntAttr:$umax,
2791
2801
APIntAttr:$smin,
@@ -2819,6 +2829,18 @@ def TestIncrementOp : TEST_Op<"increment",
2819
2829
def TestReflectBoundsOp : TEST_Op<"reflect_bounds",
2820
2830
[DeclareOpInterfaceMethods<InferIntRangeInterface, ["inferResultRanges"]>,
2821
2831
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
+
2822
2844
let arguments = (ins InferIntRangeType:$value,
2823
2845
OptionalAttr<APIntAttr>:$umin,
2824
2846
OptionalAttr<APIntAttr>:$umax,
0 commit comments