[clang] [Clang][AMDGPU] Stop defaulting to `one-as` for all atomic scopes (PR #120095)
Tony Tye via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 3 13:41:41 PST 2025
================
@@ -537,7 +537,11 @@ AMDGPUTargetCodeGenInfo::getLLVMSyncScopeID(const LangOptions &LangOpts,
break;
}
- if (Ordering != llvm::AtomicOrdering::SequentiallyConsistent) {
+ // OpenCL assumes by default that atomic scopes are per-address space for
+ // non-sequentially consistent operations.
+ if (Scope >= SyncScope::OpenCLWorkGroup &&
----------------
t-tye wrote:
It looks like the code is using the argument to specify what memory model semantics are being requested. This function is not itself OpenCL specific. It would be the caller of this function that has to decide if it wants to use the OpenCL specific enumerators or not. The caller may decide based on the language being compiler, or may be due to a piece of code being in another language with some pragma that can be used to specify a request for OpenCL memory model semantics. This function itself is just specting the meaning of the argument it is given.
Or am I missing something?
https://github.com/llvm/llvm-project/pull/120095
More information about the cfe-commits
mailing list