[Mlir-commits] [mlir] [mlir][linalg] Reject unsigned pooling on non-integer element types (PR #166070)
Andrzej WarzyĆski
llvmlistbot at llvm.org
Wed Nov 19 02:09:18 PST 2025
================
@@ -579,13 +579,23 @@ class RegionBuilderHelper {
return arith::MinSIOp::create(builder, arg0.getLoc(), arg0, arg1);
case BinaryFn::max_unsigned:
assert(!allComplex);
- if (allFloatingPoint)
- return arith::MaximumFOp::create(builder, arg0.getLoc(), arg0, arg1);
+ if (!allInteger || allBool) {
+ if (emitError) {
+ emitError() << "unsupported operation: unsigned max not on uint";
+ return nullptr;
+ }
+ llvm_unreachable("unsupported operation: unsigned max not on uint");
+ }
----------------
banach-space wrote:
I'm not really familiar with OPDSL, but in ideal world we should be able to write verification tests and add them in https://github.com/llvm/llvm-project/blob/main/mlir/test/Dialect/Linalg/invalid.mlir - could you try @Men-cotton ?
https://github.com/llvm/llvm-project/pull/166070
More information about the Mlir-commits
mailing list