]> granicus.if.org Git - clang/commit
[CUDA] Implement atomicInc and atomicDec builtins
authorJustin Lebar <jlebar@google.com>
Tue, 22 Mar 2016 00:09:28 +0000 (00:09 +0000)
committerJustin Lebar <jlebar@google.com>
Tue, 22 Mar 2016 00:09:28 +0000 (00:09 +0000)
commit1c761d812ce4944463f5ed46e3b75eaad76cb5ee
tree4d3422c047dbc55c828e7b9a8a8564f579b95c1c
parentd8ee1e5a08286092c654058b5e1b60efa5553237
[CUDA] Implement atomicInc and atomicDec builtins

These functions cannot be implemented as atomicrmw or cmpxchg
instructions, so they are implemented as a call to the NVVM intrinsics
@llvm.nvvm.atomic.load.inc.32.p0i32 and
@llvm.nvvm.atomic.load.dec.32.p0i32.

Patch by Jason Henline.

Reviewers: jlebar

Differential Revision: http://reviews.llvm.org/D18322

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264009 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGBuiltin.cpp
test/CodeGen/builtins-nvptx.c