Skip to content

Commit

Permalink
add initialized attribute LangRef
Browse files Browse the repository at this point in the history
  • Loading branch information
haopliu committed Feb 15, 2024
1 parent 4bf50e0 commit 69a96ae
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions llvm/docs/LangRef.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 69a96ae

Please sign in to comment.