Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion llvm/docs/LangRef.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4480,7 +4480,7 @@ the type size is smaller than the type's store size.
< vscale x <# elements> x <elementtype> > ; Scalable vector

The number of elements is a constant integer value larger than 0;
elementtype may be any integer, floating-point, pointer type, or a sized
elementtype may be any integer, floating-point, pointer type, or a sized
target extension type that has the ``CanBeVectorElement`` property. Vectors
of size zero are not allowed. For scalable vectors, the total number of
elements is a constant multiple (called vscale) of the specified number
Expand Down Expand Up @@ -8351,6 +8351,37 @@ spaces. The interpretation of the address space values is target specific.
The behavior is undefined if the runtime memory address does
resolve to an object defined in one of the indicated address spaces.

'``mmra``' Metadata
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The ``mmra`` metadata represents target-defined properties on instructions that
can be used to selectively relax constraints placed by the memory model.

Refer to :doc:`MemoryModelRelaxationAnnotations` for more information on how this metadata
affects the memory model of a given target.

It is attached to memory instructions such as:
:ref:`atomicrmw <i_atomicrmw>`, :ref:`cmpxchg <i_cmpxchg>`, :ref:`load <i_load>`,
:ref:`store <i_store>`, :ref:`fence <i_fence>` and
:ref:`call <i_call>` instructions that read or write memory.

The metadata is structured as pairs of strings: a prefix, and suffix that form a MMRA "tag".
The ``!mmra`` operand can either point to a pair of metadata strings, or a tuple containing
multiple pairs of metadata strings.

Example:

.. code-block:: llvm

; Simple pair of strings used directly:
%rmw.valid = atomicrmw and ptr %ptr, i64 %value seq_cst, !mmra !0

; Using multiple pairs of strings using a metadata tuple:
%rmw.valid = atomicrmw and ptr %ptr, i64 %value seq_cst, !mmra !2

!0 = !{!"amdgpu-synchronize-as", !"global"}
!1 = !{!"amdgpu-synchronize-as", !"private"}
!2 = !{!0, !1}

Module Flags Metadata
=====================
Expand Down
Loading