[llvm] asm clobber constrains: '~memory' allows reads and synchronization (PR #150191)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 23 02:07:55 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-ir
Author: Ralf Jung (RalfJung)
<details>
<summary>Changes</summary>
Cc @<!-- -->nikic -- does this sound right? I was not sure what the best way is for talking about "synchronization effects".
---
Full diff: https://github.com/llvm/llvm-project/pull/150191.diff
1 Files Affected:
- (modified) llvm/docs/LangRef.rst (+7-4)
``````````diff
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index bac13cc0424a6..9f792fa392cca 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -5448,10 +5448,13 @@ Clobber constraints
A clobber constraint is indicated by a "``~``" prefix. A clobber does not
consume an input operand, nor generate an output. Clobbers cannot use any of the
general constraint code letters -- they may use only explicit register
-constraints, e.g. "``~{eax}``". The one exception is that a clobber string of
-"``~{memory}``" indicates that the assembly writes to arbitrary undeclared
-memory locations -- not only the memory pointed to by a declared indirect
-output.
+constraints, e.g. "``~{eax}``".
+
+The one exception is that a clobber string of "``~{memory}``" indicates that the
+assembly reads and writes arbitrary undeclared memory locations -- not only the
+memory pointed to by a declared indirect output. Furthermore, the assembly may
+also cause synchronization with other threads, such as via release/acquire
+fences and atomic memory accesses.
Note that clobbering named registers that are also present in output
constraints is not legal.
``````````
</details>
https://github.com/llvm/llvm-project/pull/150191
More information about the llvm-commits
mailing list