llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[NVPTX] llvm.nvvm.atomic.load.add should be autoupgraded to a device scoped atomic

Open akshayrdeodhar opened this issue 7 months ago • 1 comments

__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.

akshayrdeodhar avatar May 06 '26 00:05 akshayrdeodhar

Fixed with https://github.com/llvm/llvm-project/pull/198431

akshayrdeodhar avatar May 19 '26 17:05 akshayrdeodhar