[llvm] 69a96ae - add initialized attribute LangRef

Haopeng Liu via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 15 14:22:15 PST 2024


Author: Haopeng Liu
Date: 2024-02-15T22:17:56Z
New Revision: 69a96ae0e80f0e62c1f25a1c255a3f46ff7dc9e8

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

LOG: add initialized attribute LangRef

Added: 
    

Modified: 
    llvm/docs/LangRef.rst

Removed: 
    


################################################################################
diff  --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index fd2e3aacd0169c..6f7a0fd3f7ba5a 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -1589,6 +1589,23 @@ Currently, only the following parameter attributes are defined:
     ``readonly`` or a ``memory`` attribute that does not contain
     ``argmem: write``.
 
+``initialized((Lo1,Hi1),...)``
+    This attribute is a list of const ranges in ascending order with no
+    overlapping or continuous. It indicates that the function initializes the
+    memory through the pointer argument, [%p+LoN, %p+HiN), and there is no read
+    before initialization in the function. (even though it may read before
+    initializating the memory that the pointer points to).
+
+    The ``writable`` or ``dereferenceable`` attribute does not imply
+    ``initialized`` attribute, however the ``initialized`` argument does imply
+    ``writable`` and ``dereferenceable`` in the specified spaces.
+
+    The ``initialized`` attribute can combine with ``writeonly`` attribute, but
+    cannot be combined with ``readnone``, ``readonly`` or a memory attribute
+    that does not contain ``argmem: write``.
+
+    [TODO: unwind]
+
 ``dead_on_unwind``
     At a high level, this attribute indicates that the pointer argument is dead
     if the call unwinds, in the sense that the caller will not depend on the


        


More information about the llvm-commits mailing list