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

Andrzej WarzyƄski llvmlistbot at llvm.org
Wed May 8 08:36:47 PDT 2024


banach-space wrote:

> Implementation details of the folder aren't relevant to the op semantics I believe.

Agreed. It wasn't clear to me what the expectation was, so I proposed sth to progress the discussion. Like you said, it's an implementation detail, so let me revert that.

>  my only concern is we are discovering more overflow cases that don't lower / fold properly yet are allowed by the op spec.

The cases that's being fixed here is not  `arith.ceildivsi` overflow. Also, based on the the spec, I assume that we don't really care how overflow cases are lowered/folded (additional emphasis from me):

> Divison by zero, or signed division overflow (minimum value divided by -1) is **undefined behavior**. 

I feel that we are all on the same page here, so I will land this later today. Please let me know if you feel differently.

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


More information about the Mlir-commits mailing list