Skip to content

Commit b9f0c27

Browse files
committed
Alternative: inline assembly.
1 parent f2d740e commit b9f0c27

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

text/0000-compiler-fence-intrinsics.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ appropriate.
4949
negative impact on performance in some situations where a compiler-only fence
5050
is appropriate.
5151

52+
* Recommend inline assembly to get a similar effect, such as `asm!("" :::
53+
"memory" : "volatile")`. LLVM provides an IR item specifically for this case
54+
(`fence singlethread`), so I believe taking advantage of that feature in LLVM is
55+
most appropriate, since its semantics are more rigorously defined and less
56+
likely to yield unexpected (but not necessarily wrong) behavior.
57+
5258
# Unresolved questions
5359

5460
These intrinsics may be better represented with a different name, such as

0 commit comments

Comments
 (0)