[PATCH] D50391: [NVPTX] Select atomic loads and stores

Jonas Hahnfeld via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 7 09:11:13 PDT 2018


Hahnfeld created this revision.
Hahnfeld added reviewers: jlebar, tra, ABataev, bkramer.
Herald added subscribers: llvm-commits, jfb, jholewinski.

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D50391

Files:
  lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp
  test/CodeGen/NVPTX/load-store.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50391.159521.patch
Type: text/x-patch
Size: 12382 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180807/89a95bb8/attachment.bin>


More information about the llvm-commits mailing list