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

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 15 19:35:05 PDT 2020


aqjune created this revision.
aqjune added reviewers: nikic, spatel, jdoerfert, efriedma, lebedev.ri.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83927

Files:
  llvm/docs/LangRef.rst


Index: llvm/docs/LangRef.rst
===================================================================
--- llvm/docs/LangRef.rst
+++ llvm/docs/LangRef.rst
@@ -3523,6 +3523,9 @@
 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 different type.
 
 .. code-block:: llvm
 
@@ -10681,6 +10684,9 @@
 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 different type.
 
 
 Example:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83927.278360.patch
Type: text/x-patch
Size: 1044 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200716/9dceb630/attachment.bin>


More information about the llvm-commits mailing list