llvm-project
llvm-project copied to clipboard
[NVPTX] llvm.nvvm.atomic.load.add should be autoupgraded to a device scoped atomic
__nvvm_atom_XXX_gen are device-scoped, monotonic atomic builtins. Of these, __nvvm_atom_load_add gets autoupgraded to a default system-scoped atomicrmw instruction.
Originally, scopes on atomicrmw were dropped while lowering, and were incorrectly being lowered to the default PTX scope, which is gpu/device. Now, these intrinsics will be silently autoupgraded to a larger scope (system). This is correct, but less performant.
Fixed with https://github.com/llvm/llvm-project/pull/198431