[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 05:33:46 PDT 2019


lebedev.ri added inline comments.


================
Comment at: llvm/docs/LangRef.rst:10173-10174
+Otherwise, this instruction is a no-op and returns the input argument.
+All uses of a '``freeze``' instruction are guaranteed to always observe
+the same value.
+
----------------
Can/should this be reworded then to avoid that misreading i just did?
I'd expect to see something closer to
```
All uses of a value returned from the same '``freeze``' instruction are
guaranteed to always observe the same value, but different '``freeze``'
instructions may yield different values.
```


================
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
----------------
nlopes wrote:
> lebedev.ri wrote:
> > 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
> > ```
> That is not correct. Only all uses of a given freeze instruction are guaranteed to have the same value.
> Different `freeze %x` may yield different values.
Oh


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D29121/new/

https://reviews.llvm.org/D29121





More information about the llvm-commits mailing list