[llvm] [NVPTX] Fix scoped atomic when given runtime values (PR #185883)

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 16 15:50:05 PDT 2026


jhuber6 wrote:

> Thanks for explaining Joseph.
> 
> I think that for the NVPTX target, the following makes sense:
> 
>     * `syncscope("singlethread")`:
>       
>       * operation -> non-atomic operation.
>       * fence -> dropped.
>         
>         * Rationale: we don't need to lower `std::atomic_signal_fence` to anything at PTX level.
> 
>     * `syncscope("cluster")` operation/fence on targets without cluster support: narrow scope to `block`.
>       
>       * Rationale: clusters precisely contain 1 block in those targets, therefore `block` suffices.

Alright, I think this works. I just went and deleted the `cluster-fence.ll` and `nocluster-fence.ll` because we support them in a uniform manner now.

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


More information about the llvm-commits mailing list