Skip to content

Commit a9e8f3a

Browse files
committed
fixup! fixup! fixup! fixup! fixup! [mlir][arith] Fix overflow bug in arith::CeilDivSIOp::fold
Add comments
1 parent 2609857 commit a9e8f3a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

mlir/include/mlir/Dialect/Arith/IR/ArithOps.td

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -587,10 +587,11 @@ def Arith_CeilDivSIOp : Arith_IntBinaryOp<"ceildivsi",
587587
let description = [{
588588
Signed integer division. Rounds towards positive infinity, i.e. `7 / -2 = -3`.
589589

590-
Divison by zero, or signed division overflow (minimum value divided by -1)
591-
is undefined behavior. When applied to `vector` and `tensor` values, the
592-
behavior is undefined if _any_ of its elements are divided by zero or has a
593-
signed division overflow.
590+
Divison by zero, or signed division overflow (minimum value divided by -1)
591+
is undefined behavior. While dividing minimum value by a value != -1 shouldn't
592+
overflow, the current implementation treats it as such. When applied to `vector`
593+
and `tensor` values, the behavior is undefined if _any_ of its elements are
594+
divided by zero or has a signed division overflow.
594595

595596
Example:
596597

0 commit comments

Comments
 (0)