[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 Jan 6 06:06:06 PST 2025


jhuber6 wrote:

> I'm trying to understand this. Is the function being changed a generic util called by multiple builtins, and this change is just to make `one-as` exclusive to the OpenCL variant of those builtins ? Can an identical builtin have different behavior depending on the input language (e.g. OpenCL or C++ mode) ?

`one-as` is an OpenCL specific weakening of the atomic memory model. We want to preserve this on OpenCL's builtins but remove it for other atomic codegen. This patch changes the behavior to only add `one-as` if the user called the `__opencl_atomic` builtin, regardless of language.

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


More information about the cfe-commits mailing list