[Mlir-commits] [mlir] [mlir][Interfaces] Track and infer no-overflow flags in integer ranges (PR #191777)

Hocky Yudhiono llvmlistbot at llvm.org
Thu Apr 16 01:01:56 PDT 2026


================
@@ -3356,10 +3356,11 @@ def TestReflectBoundsOp : TEST_Op<"reflect_bounds",
                        OptionalAttr<APIntAttr>:$umin,
                        OptionalAttr<APIntAttr>:$umax,
                        OptionalAttr<APIntAttr>:$smin,
-                       OptionalAttr<APIntAttr>:$smax);
+                       OptionalAttr<APIntAttr>:$smax,
+                       OptionalAttr<UI32Attr>:$overflow);
   let results = (outs InferIntRangeType:$result);
 
-  let assemblyFormat = "attr-dict $value `:` type($result)";
+  let hasCustomAssemblyFormat = 1;
----------------
hockyy wrote:

> In such cases, you can use a custom printer/parser, but just for this field: https://mlir.llvm.org/docs/DefiningDialects/AttributesAndTypes/#custom-and-ref-directive

Addressed, noted for the future too.

https://github.com/llvm/llvm-project/pull/191777


More information about the Mlir-commits mailing list