diff options
| author | Justin Lebar <jlebar@google.com> | 2017-11-07 22:10:54 +0000 |
|---|---|---|
| committer | Justin Lebar <jlebar@google.com> | 2017-11-07 22:10:54 +0000 |
| commit | da9e0bd3a238f80b05a3070c8a8a3cadadc12e5f (patch) | |
| tree | 011bda2e7fcd416411315d3d88afd8309e9aeb08 /llvm/test/CodeGen/NVPTX | |
| parent | 3ae8dfda06ff63d16673b1db9e0ce73ce0b8a3f5 (diff) | |
| download | bcm5719-llvm-da9e0bd3a238f80b05a3070c8a8a3cadadc12e5f.tar.gz bcm5719-llvm-da9e0bd3a238f80b05a3070c8a8a3cadadc12e5f.zip | |
[NVPTX] Implement __nvvm_atom_add_gen_d builtin.
Summary:
This just seems to have been an oversight. We already supported the f64
atomic add with an explicit scope (e.g. "cta"), but not the scopeless
version.
Reviewers: tra
Subscribers: jholewinski, sanjoy, cfe-commits, llvm-commits, hiraditya
Differential Revision: https://reviews.llvm.org/D39638
llvm-svn: 317623
Diffstat (limited to 'llvm/test/CodeGen/NVPTX')
| -rw-r--r-- | llvm/test/CodeGen/NVPTX/atomics-sm60.ll | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/NVPTX/atomics-sm60.ll b/llvm/test/CodeGen/NVPTX/atomics-sm60.ll new file mode 100644 index 00000000000..0b5bafb780c --- /dev/null +++ b/llvm/test/CodeGen/NVPTX/atomics-sm60.ll @@ -0,0 +1,19 @@ +; RUN: llc < %s -march=nvptx -mcpu=sm_60 | FileCheck %s +; RUN: llc < %s -march=nvptx64 -mcpu=sm_60 | FileCheck %s + +; CHECK-LABEL .func test( +define void @test(double* %dp0, double addrspace(1)* %dp1, double addrspace(3)* %dp3, double %d) { +; CHECK: atom.add.f64 + %r1 = call double @llvm.nvvm.atomic.load.add.f64.p0f64(double* %dp0, double %d) +; CHECK: atom.global.add.f64 + %r2 = call double @llvm.nvvm.atomic.load.add.f64.p1f64(double addrspace(1)* %dp1, double %d) +; CHECK: atom.shared.add.f64 + %ret = call double @llvm.nvvm.atomic.load.add.f64.p3f64(double addrspace(3)* %dp3, double %d) + ret void +} + +declare double @llvm.nvvm.atomic.load.add.f64.p0f64(double* nocapture, double) #1 +declare double @llvm.nvvm.atomic.load.add.f64.p1f64(double addrspace(1)* nocapture, double) #1 +declare double @llvm.nvvm.atomic.load.add.f64.p3f64(double addrspace(3)* nocapture, double) #1 + +attributes #1 = { argmemonly nounwind } |

