[llvm] [LangRef] asm clobber constrains: '~memory' allows reads and synchronization (PR #150191)
Ralf Jung via llvm-commits
llvm-commits at lists.llvm.org
Sat Dec 13 03:11:25 PST 2025
https://github.com/RalfJung updated https://github.com/llvm/llvm-project/pull/150191
>From 14cf310d4c41a2d55996d69665131b0319565f1b Mon Sep 17 00:00:00 2001
From: Ralf Jung <post at ralfj.de>
Date: Wed, 23 Jul 2025 11:06:14 +0200
Subject: [PATCH] asm clobber constrains: '~memory' allows reads and
synchronization
---
llvm/docs/LangRef.rst | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 5fa3a4ebb2472..999773f89c6bf 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -5635,10 +5635,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.
More information about the llvm-commits
mailing list