@@ -145,7 +145,9 @@ Undef Values
145145------------
146146.. warning ::
147147 Undef values are deprecated and should be used only when strictly necessary.
148- No new uses should be added unless justified.
148+ Uses of undef values should be restricted to representing loads of
149+ uninitialized memory. This is the only part of the IR semantics that cannot
150+ be replaced with alternatives yet (work in ongoing).
149151
150152An undef value represents any value of a given type. Moreover, each use of
151153an instruction that depends on undef can observe a different value.
@@ -202,11 +204,6 @@ This optimization is wrong just because undef values exist, even if they are
202204not used in this part of the program as LLVM has no way to tell if ``%v `` is
203205undef or not.
204206
205- .. note ::
206- Uses of undef values should be restricted to representing loads of
207- uninitialized memory. This is the only part of the IR semantics that cannot
208- be replaced with alternatives yet (work in ongoing).
209-
210207Looking at the value lattice, ``undef `` values can only be replaced with either
211208a ``freeze `` instruction or a concrete value.
212209A consequence is that giving undef as an operand to an instruction that triggers
@@ -391,3 +388,6 @@ The lattice of values in LLVM is:
391388immediate UB > poison > undef > freeze(poison) > concrete value.
392389It is only valid to transform values from the left to the right (e.g., a poison
393390value can be replaced with a concrete value, but not the other way around).
391+
392+ Undef is now deprecated and should be used only to represent loads of
393+ uninitialized memory.
0 commit comments