[Mlir-commits] [mlir] [mlir][arith] Implement ValueBoundsOpInterface for min/max ops (PR #203269)

Matthias Springer llvmlistbot at llvm.org
Fri Jun 12 01:58:39 PDT 2026


================
@@ -160,6 +160,70 @@ struct SelectOpInterface
     populateBounds(cast<SelectOp>(op), dim, cstr);
   }
 };
+
+struct MinUIOpInterface
----------------
matthias-springer wrote:

I believe the `MinUIOpInterface` and `MaxUIOpInterface` are incorrect. `ValueBoundsOpInterface` implementations feed into a constraint set and it interprets integers as "signed".

Example:
```
%0 = arith.constant 0xFF : i8  // signed -1, unsigned 255
%1 = arith.constant 0x01 : i8  // signed  1, unsigned 1
%2 = arith.minui %0, %1 : i8
```

We would be adding these two inequalities into the constraint set:
```
%2 <= -1
%2 <= 1
```

I'm not sure if unsigned integer arithmetics can be supported by this infrastructure in a safe way. For now, I would just delete the unsigned interface implementations and merge the signed ones.

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


More information about the Mlir-commits mailing list