[llvm] [llvm] Support invariant.load on readonly intrinsics (PR #205916)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 26 06:04:07 PDT 2026
================
@@ -12075,11 +12075,11 @@ as the ``MOVNT`` instruction on x86.
The optional ``!invariant.load`` metadata must reference a single
metadata name ``<empty_node>`` corresponding to a metadata node with no
-entries. If a load instruction tagged with the ``!invariant.load``
-metadata is executed, the memory location referenced by the load has
-to contain the same value at all points in the program where the
-memory location is dereferenceable; otherwise, the behavior is
-undefined.
+entries. If a ``!invariant.load``-tagged operation is executed, and that
+operation is either a load instruction or a call to an intrinsic that reads
+memory and does not write memory, every memory location read by the operation
+must contain the same value at all points in the program where that memory
+location is dereferenceable; otherwise, the behavior is undefined.
----------------
nikic wrote:
Should move this out of the load docs into a dedicated section for the metadata.
https://github.com/llvm/llvm-project/pull/205916
More information about the llvm-commits
mailing list