[llvm] [NVPTX] Add syncscope support for cmpxchg (PR #140812)
Akshay Deodhar via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 30 21:05:07 PDT 2025
akshayrdeodhar wrote:
> > Can we do this without modifying the base API? Looks like the SSID information is enclosed in the instruction which we can query in NVPTX specific `NVPTXTargetLowering::emitTrailingFence`/`NVPTXTargetLowering::emitLeadingFence`.
>
> For what it's worth, I think it's helpful to modify the base API because some targets in an internal LLVM fork would also benefit from scoping fences. This is cleaner than having to check the type of the instruction in both functions. Perhaps it would be better done in a separate patch though!
@zhaorv - sorry for the late reply.
Thank you for this. The reasoning behind not modifying the base API was this- in any expansion, the scope of the fence will be the same as the scope of the cmpxchg. The cmpxchg will always retain its scope. Atleast in NVPTX we don't see a counterexample. Do you have a counterexample for this?
https://github.com/llvm/llvm-project/pull/140812
More information about the llvm-commits
mailing list