[llvm] c3a9625 - [LangRef] Clarify interaction of noalias and synchronization (#211507)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 24 01:24:09 PDT 2026


Author: Nikita Popov
Date: 2026-07-24T10:24:04+02:00
New Revision: c3a9625ef1437388fd92ebdddda58d980ec87229

URL: https://github.com/llvm/llvm-project/commit/c3a9625ef1437388fd92ebdddda58d980ec87229
DIFF: https://github.com/llvm/llvm-project/commit/c3a9625ef1437388fd92ebdddda58d980ec87229.diff

LOG: [LangRef] Clarify interaction of noalias and synchronization (#211507)

Noalias applies to accesses on other threads, but this was not very
clear in existing wording, because "during the execution of the
function" is somewhat ambiguous.

Explicitly mention that it applies to accesses from other threads. This
means that conflicting accesses (i.e. not read-read) need to either
happen-before function entry, or function exit needs to happen-before
them, otherwise behavior is undefined. For accesses not based on the
noalias pointer, this requires synchronization *outside* the function.

Added: 
    

Modified: 
    llvm/docs/LangRef.md

Removed: 
    


################################################################################
diff  --git a/llvm/docs/LangRef.md b/llvm/docs/LangRef.md
index 13b90cefbd269..d6477b61bcb0e 100644
--- a/llvm/docs/LangRef.md
+++ b/llvm/docs/LangRef.md
@@ -1522,6 +1522,12 @@ Currently, only the following parameter attributes are defined:
     met. For further details, please see the discussion of the NoAlias response
     in {ref}`alias analysis <Must, May,  or No>`.
 
+    `noalias` also applies to accesses from other threads, unless they
+    happen-before function entry, or function exit happens-before them. This
+    means that conflicting concurrent accesses from other threads either need
+    to be based on the noalias pointer, or else be appropriately synchronized
+    *outside* the function.
+
     Note that this definition of `noalias` is intentionally similar
     to the definition of `restrict` in C99 for function arguments.
 


        


More information about the llvm-commits mailing list