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

Mehdi Amini llvmlistbot at llvm.org
Wed Apr 15 03:02:45 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;
----------------
joker-eph wrote:

> If it's in the attr-dict, I will have to change all // CHECK:  that contains this test.reflect_bound because all of them will fail. (it will change to {overflow : xxx, smin: xxx, ... }

Aren't changing them anyway right now? Whether the flag is at the beginning or the end, the line changes...

> So I was thinking of emitting the overflow from the print and making it as a separate overflow<xxx>-like after the attr-dict.

OK, but that's not answering why you need a custom parser instead of doing this in the assembly format?

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


More information about the Mlir-commits mailing list