aboutsummaryrefslogtreecommitdiff
path: root/llvm/docs
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/docs')
-rw-r--r--llvm/docs/DirectXUsage.rst8
-rw-r--r--llvm/docs/LangRef.rst29
2 files changed, 33 insertions, 4 deletions
diff --git a/llvm/docs/DirectXUsage.rst b/llvm/docs/DirectXUsage.rst
index 1d964e6..78f27d8 100644
--- a/llvm/docs/DirectXUsage.rst
+++ b/llvm/docs/DirectXUsage.rst
@@ -29,7 +29,7 @@ Initially the backend is aimed at supporting DirectX 12, and support for DirectX
11 is planned at a later date.
The DirectX backend is currently experimental and is not shipped with any
-release builds of LLVM tools. To enable building the DirectX backend locally add
+release builds of LLVM tools. To build the DirectX backend locally, add
``DirectX`` to the ``LLVM_EXPERIMENTAL_TARGETS_TO_BUILD`` CMake option. For more
information on building LLVM see the :doc:`CMake` documentation.
@@ -38,7 +38,7 @@ information on building LLVM see the :doc:`CMake` documentation.
Target Triples
==============
-At present the DirectX target only supports the ``dxil`` architecture, which
+At present, the DirectX target only supports the ``dxil`` architecture, which
generates code for the
`DirectX Intermediate Language. <https://github.com/microsoft/DirectXShaderCompiler/blob/main/docs/DXIL.rst>`_
@@ -46,8 +46,8 @@ In addition to target architecture, the DirectX backend also needs to know the
target runtime version and pipeline stage. These are expressed using the OS and
Environment triple component.
-Presently the DirectX backend requires targeting the ``shadermodel`` OS, and
-supports versions 6.0+ (at time of writing the latest announced version is 6.7).
+Presently, the DirectX backend requires targeting the ``shadermodel`` OS, and
+supports versions 6.0+ (as of writing, the latest announced version is 6.7).
.. table:: DirectX Environments
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 8e86393..22b58bf 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -1489,6 +1489,8 @@ Currently, only the following parameter attributes are defined:
function, returning a pointer to allocated storage disjoint from the
storage for any other object accessible to the caller.
+.. _captures_attr:
+
``captures(...)``
This attribute restricts the ways in which the callee may capture the
pointer. This is not a valid attribute for return values. This attribute
@@ -7543,6 +7545,33 @@ The number of bytes known to be dereferenceable is specified by the integer
value in the metadata node. This is analogous to the ''dereferenceable_or_null''
attribute on parameters and return values.
+'``captures``' Metadata
+^^^^^^^^^^^^^^^^^^^^^^^
+
+The ``!captures`` metadata can only be applied to ``store`` instructions with
+a pointer-typed value operand. It restricts the capturing behavior of the store
+value operand in the same way the ``captures(...)`` attribute would do on a
+call. See the :ref:`pointer capture section <pointercapture>` for a detailed
+discussion of capture semantics.
+
+The ``!captures`` metadata accepts a non-empty list of strings from the same
+set as the :ref:`captures attribute <captures_attr>`:
+``!"address"``, ``!"address_is_null"``, ``!"provenance"`` and
+``!"read_provenance"``. ``!"none"`` is not supported.
+
+For example ``store ptr %x, ptr %y, !captures !{!"address"}`` indicates that
+the copy of pointer ``%x`` stored to location ``%y`` will only be used to
+inspect its integral address value, and not dereferenced. Dereferencing the
+pointer would result in undefined behavior.
+
+Similarly ``store ptr %x, ptr %y, !captures !{!"address", !"read_provenance"}``
+indicates that while reads through the stored pointer are allowed, writes would
+result in undefined behavior.
+
+The ``!captures`` attribute makes no statement about other uses of ``%x``, or
+uses of the stored-to memory location after it has been overwritten with a
+different value.
+
.. _llvm.loop:
'``llvm.loop``'