]> granicus.if.org Git - llvm/commit
Merging r339316:
authorHans Wennborg <hans@hanshq.net>
Thu, 9 Aug 2018 12:37:40 +0000 (12:37 +0000)
committerHans Wennborg <hans@hanshq.net>
Thu, 9 Aug 2018 12:37:40 +0000 (12:37 +0000)
commitf7ec630085d9746dc26713dfb7c2c0fc8a691251
tree43bbad721c0e98c8a7cd8d87e16f43b6d082c5ac
parentef7dd703b18efb1109df25124f91d05444358790
Merging r339316:
------------------------------------------------------------------------
r339316 | hahnfeld | 2018-08-09 09:45:49 +0200 (Thu, 09 Aug 2018) | 16 lines

[NVPTX] Select atomic loads and stores

According to PTX ISA .volatile has the same memory synchronization
semantics as .relaxed.sys, so it can be used to implement monotonic
atomic loads and stores. This is important for OpenMP's atomic
construct where
 - 'read's and 'write's are lowered to atomic loads and stores, and
 - an update of float or double types are lowered into a cmpxchg loop.
(Note that PTX could do better because it has atom.add.f{32,64} but
LLVM's atomicrmw instruction only allows integer types.)

Higher levels of atomicity (like acquire and release) need additional
synchronization properties which were added with PTX ISA 6.0 / sm_70.
So using these instructions still results in an error.

Differential Revision: https://reviews.llvm.org/D50391
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_70@339338 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp
test/CodeGen/NVPTX/load-store.ll [new file with mode: 0644]