[llvm-branch-commits] [clang] clang/AMDGPU: Set noalias.addrspace metadata on atomicrmw (PR #102462)

Artem Belevich via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Aug 8 11:11:55 PDT 2024


================
@@ -647,6 +647,14 @@ class LangOptions : public LangOptionsBase {
     return ConvergentFunctions;
   }
 
+  /// Return true if atomicrmw operations targeting allocations in private
+  /// memory are undefined.
+  bool threadPrivateMemoryAtomicsAreUndefined() const {
+    // Should be false for OpenMP.
+    // TODO: Should this be true for SYCL?
+    return OpenCL || CUDA;
----------------
Artem-B wrote:

@gonzalobg -- Does NVIDIA define what happens if atomics are used on local address space?

@arsenm  atomics/and AS relationship seems to be a property of the target, not the language. I.e. we could potentially have a different answer for HIP on AMDGPU and CUDA on NVPTX, even though both would have `LangOpts.CUDA=true`.

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


More information about the llvm-branch-commits mailing list