Skip to content

[LangRef] asm clobber constrains: '~memory' allows reads and synchronization #150191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
11 changes: 7 additions & 4 deletions llvm/docs/LangRef.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading