[clang] [Clang][HIP] Deprecate __hip_atomic_* builtins (PR #189897)
Joseph Huber via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 1 05:36:15 PDT 2026
================
@@ -4565,6 +4565,91 @@ ExprResult Sema::AtomicOpsOverloaded(ExprResult TheCallResult,
Op);
}
+/// Deprecate __hip_atomic_* builtins in favour of __scoped_atomic_*
+/// equivalents. Provide a fixit when the scope is a compile-time constant and
----------------
jhuber6 wrote:
I'm curious if we shouldn't just put the fixit on the scope and atomics separately, that would catch this case.
```c++
template <typename T> T foo(T *ptr, int ord, int scp) {
return __hip_atomic_load(ptr, ord, scp);
}
int *p;
foo(p, __ATOMIC_RELAXED, __HIP_MEMORY_SCOPE_AGENT);
```
https://github.com/llvm/llvm-project/pull/189897
More information about the cfe-commits
mailing list