Skip to content

Commit 241ec83

Browse files
committed
[LangRef] Clarify semantics for sdiv poison -1
Documents in the LangRef that ``sdiv poison -1`` triggers immediate undefined behavior. Despite it being already documented in "immediate undefined behavior occurs if a poison value is used as an instruction operand that has any values that trigger undefined behavior", it is a corner case that is worth mentioning explicitely.
1 parent 52639d6 commit 241ec83

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/docs/LangRef.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4917,6 +4917,8 @@ behavior. Notably this includes (but is not limited to):
49174917
space).
49184918
- The divisor operand of a ``udiv``, ``sdiv``, ``urem`` or ``srem``
49194919
instruction.
4920+
- The dividend operand of a ``sdiv`` or ``srem`` instruction when the divisor
4921+
is -1.
49204922
- The condition operand of a :ref:`br <i_br>` instruction.
49214923
- The callee operand of a :ref:`call <i_call>` or :ref:`invoke <i_invoke>`
49224924
instruction.

0 commit comments

Comments
 (0)