[PATCH] D29121: [Docs] Add LangRef documention for freeze instruction

Nuno Lopes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 16 05:25:45 PDT 2019


nlopes marked 2 inline comments as done.
nlopes added inline comments.


================
Comment at: llvm/docs/LangRef.rst:3318
-Additionally, undefined behavior occurs if a side effect *depends* on poison.
-This includes side effects that are control dependent on a poisoned branch.
 
----------------
jdoerfert wrote:
> Why did we get rid of the side effect on poison is UB stuff here? In the absence of freeze this is still the case, isn't it?
I'm not sure what the statement means. It doesn't seem to add extra useful information.


================
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
----------------
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.


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

https://reviews.llvm.org/D29121





More information about the llvm-commits mailing list