[Mlir-commits] [mlir] [arith][mlir] Fixed a bug in CeilDiv with neg values (PR #90855)

Andrzej WarzyƄski llvmlistbot at llvm.org
Thu May 2 12:52:06 PDT 2024


https://github.com/banach-space commented:

This example works fine without your change (-120 instead of `-128`):
```mlir
func.func @simple_arith.ceildivsi_i8() -> (i8) {
  %0 = arith.constant 7 : i8
  %1 = arith.constant -120 : i8
  // CHECK-NEXT: arith.constant -18
  %2 = arith.ceildivsi %1, %0 : i8
  return %2 : i8
}
```

So, is the issue stemming from that fact that 128 is out of range for 8 bit signed integers? I'm basically trying to understand _why_ the current implementation is incorrect in your case.

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


More information about the Mlir-commits mailing list