Skip to content

Commit dbbd4e0

Browse files
authored
[LangRef] select: describe behavior for undef and poison (#208724)
The poison semantics is based on https://llvm.org/docs/UndefinedBehavior.html#propagation-of-poison-through-select. IMO this definitely should appear in the "semantics" section of the `select` instruction. If this isn't part of the `select` semantics I don't know what is. The undef semantics are based on what Alive does.
1 parent add1925 commit dbbd4e0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

llvm/docs/LangRef.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13392,7 +13392,8 @@ values indicating the condition, and two values of the same {ref}`first class <t
1339213392

1339313393
If the condition is an i1 and it evaluates to 1, the instruction returns
1339413394
the first value argument; otherwise, it returns the second value
13395-
argument.
13395+
argument. If the condition evaluates to `poison`, the instruction returns `poison`.
13396+
If it evaluates to `undef`, the result is an `undef` representing the union of two value arguments (i.e., each use of this value can pick either value argument).
1339613397

1339713398
If the condition is a vector of i1, then the value arguments must be
1339813399
vectors of the same size, and the selection is done element by element.

0 commit comments

Comments
 (0)