[Mlir-commits] [mlir] [mlir][arith] Fix overflow bug in arith::CeilDivSIOp::fold (PR #90947)

Andrzej WarzyƄski llvmlistbot at llvm.org
Mon May 6 07:07:30 PDT 2024


banach-space wrote:

> Do we need to update the wording around overflow conditions in the op docs? https://mlir.llvm.org/docs/Dialects/ArithOps/#arithceildivsi-arithceildivsiop this doesn't define what we understand by signed division overflow

+1, but I'd rather defer to somebody with a stronger opinion and more experience with Arith.

> It is still open whether we couldn't be more aggressive though

Yes, we could be more aggressive. In fact, that's what @bviyer is proposing here:
* https://github.com/llvm/llvm-project/pull/90855

I suggested that first we make sure that we don't drop these overflow flags on the floor (i.e. that we land this PR first).

>  are there cases where we could fold but we don't right now? (if so can you add a TODO? Possibly a test for these?)

Yes, the cases in the test that I added (I've added TODOs). There might be more, but nothing obvious comes to mind. I don't see that many edge cases being tested for Arith - there might be even more room for improvement.

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


More information about the Mlir-commits mailing list