[clang] [Clang][AMDGPU] Stop defaulting to `one-as` for all atomic scopes (PR #120095)
Joseph Huber via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 3 14:26:13 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 &&
----------------
jhuber6 wrote:
Yes, each non-OpenCL function goes through this common interface. The issue is that for non-OpenCL users they all get the `one-as` feature added, which is not correct in the general case. This patch is an attempt to maintain the OpenCL behavior while the other users of this function will not longer have `one-as` on them.
https://github.com/llvm/llvm-project/pull/120095
More information about the cfe-commits
mailing list