[PATCH] D29121: [Docs] Add LangRef documention for freeze instruction
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 16 04:29:11 PDT 2019
lebedev.ri added inline comments.
================
Comment at: llvm/docs/LangRef.rst:10176
+.. code-block:: llvm
+
+ %w = i32 undef
----------------
lebedev.ri wrote:
> I can see that the scalar restriction was lifter (good)
> I think this misses 2 examples:
> 1. Some trivial vector example
> 2. An example for `All uses of a '``freeze``' instruction are guaranteed to always observe the same value.`
To clarify why i think there should be an example for `All uses of a 'freeze' instruction are guaranteed to always observe the same value.` - elsewhere it is specified that undef can 'evaluate' to a different value each time, and here we are contradicting that.
================
Comment at: llvm/docs/LangRef.rst:10159-10174
+The '``freeze``' instruction is used to stop propagation of ``undef``
+and ``poison`` values.
+
+Arguments:
+""""""""""
+
+The '``freeze``' instruction takes a single argument.
----------------
Either in `Overview` or in `Semantics` the `undef` and `poison` should be links to those langref sections.
================
Comment at: llvm/docs/LangRef.rst:10183-10186
+ %x = freeze i32 %w
+ %y = add i32 %w, %w ; undef
+ %z = add i32 %x, %x ; even number because all uses of %x observe
+ ; the same value
----------------
Could be as simple as:
```diff
+%x2 = freeze i32 %w
+%z2 = add i32 %x, %x2 ; even number because all uses of %x and %x2 observe same value
```
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D29121/new/
https://reviews.llvm.org/D29121
More information about the llvm-commits
mailing list