[libc] Implement memory fences on NVPTX
authorJoseph Huber <jhuber6@vols.utk.edu>
Thu, 23 Mar 2023 14:05:34 +0000 (09:05 -0500)
committerJoseph Huber <jhuber6@vols.utk.edu>
Thu, 23 Mar 2023 16:26:35 +0000 (11:26 -0500)
commit9c8bdbcbc502fac7d7d8da5c848cec448daf26ae
tree25f416c4425fc7efb392108f432c4abf6ac7a904
parent2bececb8bed1f8fcd8d54dba831ceb117717bfcc
[libc] Implement memory fences on NVPTX

Memory fences are not handled by the NVPTX backend. We need to replace
them with a memory barrier intrinsic function. This doesn't include the
ordering, but should perform the necessary functionality, albeit slower.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D146725
libc/src/__support/CPP/atomic.h