[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
Mon Dec 16 18:16:11 PST 2024


================
@@ -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:

It's better because it's up to the OpenCL builtin, you can still use the 'standard' builtins in OpenCL which would then give them different behavior depending on the language.

https://github.com/llvm/llvm-project/pull/120095


More information about the cfe-commits mailing list