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

I am not sure what you mean by "each implementation of this "atomic scope" 
thing". It looks like there is a single function involved here called 
AMDGPUTargetCodeGenInfo::getLLVMSyncScopeID . It takes an argument called 
scope. Its job is to correctly generate the sync-scope that should be used for 
the AMD GPU target for the given value of the scope argument. It is up to the 
callers of this function to pass the correct value for "scope". Are all the 
callers doing that correctly?

This is not about an OpenCL implementation, it is about the compiler 
implementing the correct semantics for the source code that clang is compiling. 
Clang is responsible for honoring the semantics of the source language and any 
directives it may have. Non-OpenCL source languages may want certain code to 
use the OpenCL semantics and so "invent" directives to do that, and hence may 
cause this function to be called with one of the OpenCL enumerator values.

https://github.com/llvm/llvm-project/pull/120095
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to