[llvm] fd1f807 - [LangRef] Mention that freeze does not consider aggregate's paddings

Juneyoung Lee via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 19:54:01 PDT 2020


Author: Juneyoung Lee
Date: 2020-07-17T11:53:26+09:00
New Revision: fd1f8072a863d7d542165c6bec73f415c65b2482

URL: https://github.com/llvm/llvm-project/commit/fd1f8072a863d7d542165c6bec73f415c65b2482
DIFF: https://github.com/llvm/llvm-project/commit/fd1f8072a863d7d542165c6bec73f415c65b2482.diff

LOG: [LangRef] Mention that freeze does not consider aggregate's paddings

Make explicit that freeze does not touch paddings of an aggregate.
(Relevant comment: https://reviews.llvm.org/D83752#2152550)

This implies that `v = freeze(load p); store v, q` may still leave undef bits
or poison in memory if `v` is an aggregate, but it still happens for
non-byte integers such as i1.

Differential Revision: https://reviews.llvm.org/D83927

Added: 
    

Modified: 
    llvm/docs/LangRef.rst

Removed: 
    


################################################################################
diff  --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index e42b6c1f7b0d..86d8c62af2b7 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -3523,6 +3523,9 @@ uses with" concept would not hold.
 To ensure all uses of a given register observe the same value (even if
 '``undef``'), the :ref:`freeze instruction <i_freeze>` can be used.
 A value is frozen if its uses see the same value.
+An aggregate value or vector is frozen if its elements are frozen.
+The padding of an aggregate isn't considered, since it isn't visible
+without storing it into memory and loading it with a 
diff erent type.
 
 .. code-block:: llvm
 
@@ -10682,6 +10685,9 @@ instructions may yield 
diff erent values.
 While ``undef`` and ``poison`` pointers can be frozen, the result is a
 non-dereferenceable pointer. See the
 :ref:`Pointer Aliasing Rules <pointeraliasing>` section for more information.
+If an aggregate value or vector is frozen, the operand is frozen element-wise.
+The padding of an aggregate isn't considered, since it isn't visible
+without storing it into memory and loading it with a 
diff erent type.
 
 
 Example:


        


More information about the llvm-commits mailing list