aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/CodeGen/AMDGPU/expand-atomicrmw-syncscope.ll
blob: 72de1dfa78d049f1cddc1b01c042092b0153186b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
; RUN: llc -mtriple=amdgcn -mcpu=gfx90a < %s | FileCheck -check-prefix=GCN %s

; GCN-LABEL: {{^}}expand_atomicrmw_agent:
; GCN: global_atomic_cmpswap v{{[0-9]+}}, v[{{[0-9:]+}}], v[{{[0-9:]+}}], off glc{{$}}
define void @expand_atomicrmw_agent(ptr addrspace(1) nocapture %arg) {
entry:
  %ret = atomicrmw fadd ptr addrspace(1) %arg, float 1.000000e+00 syncscope("agent") monotonic, align 4
  ret void
}

; GCN-LABEL: {{^}}expand_atomicrmw_workgroup:
; GCN: global_atomic_cmpswap v{{[0-9]+}}, v[{{[0-9:]+}}], v[{{[0-9:]+}}], off glc{{$}}
define void @expand_atomicrmw_workgroup(ptr addrspace(1) nocapture %arg) {
entry:
  %ret = atomicrmw fadd ptr addrspace(1) %arg, float 1.000000e+00 syncscope("workgroup") monotonic, align 4
  ret void
}

; GCN-LABEL: {{^}}expand_atomicrmw_wavefront:
; GCN: global_atomic_cmpswap v{{[0-9]+}}, v[{{[0-9:]+}}], v[{{[0-9:]+}}], off glc{{$}}
define void @expand_atomicrmw_wavefront(ptr addrspace(1) nocapture %arg) {
entry:
  %ret = atomicrmw fadd ptr addrspace(1) %arg, float 1.000000e+00 syncscope("wavefront") monotonic, align 4
  ret void
}

; GCN-LABEL: {{^}}expand_atomicrmw_agent_one_as:
; GCN: global_atomic_cmpswap v{{[0-9]+}}, v[{{[0-9:]+}}], v[{{[0-9:]+}}], off glc{{$}}
define void @expand_atomicrmw_agent_one_as(ptr addrspace(1) nocapture %arg) {
entry:
  %ret = atomicrmw fadd ptr addrspace(1) %arg, float 1.000000e+00 syncscope("agent-one-as") monotonic, align 4
  ret void
}

; GCN-LABEL: {{^}}expand_atomicrmw_workgroup_one_as:
; GCN: global_atomic_cmpswap v{{[0-9]+}}, v[{{[0-9:]+}}], v[{{[0-9:]+}}], off glc{{$}}
define void @expand_atomicrmw_workgroup_one_as(ptr addrspace(1) nocapture %arg) {
entry:
  %ret = atomicrmw fadd ptr addrspace(1) %arg, float 1.000000e+00 syncscope("workgroup-one-as") monotonic, align 4
  ret void
}

; GCN-LABEL: {{^}}expand_atomicrmw_wavefront_one_as:
; GCN: global_atomic_cmpswap v{{[0-9]+}}, v[{{[0-9:]+}}], v[{{[0-9:]+}}], off glc{{$}}
define void @expand_atomicrmw_wavefront_one_as(ptr addrspace(1) nocapture %arg) {
entry:
  %ret = atomicrmw fadd ptr addrspace(1) %arg, float 1.000000e+00 syncscope("wavefront-one-as") monotonic, align 4
  ret void
}

; GCN-LABEL: {{^}}expand_atomicrmw_singlethread_one_as:
; GCN: global_atomic_cmpswap v{{[0-9]+}}, v[{{[0-9:]+}}], v[{{[0-9:]+}}], off glc{{$}}
define void @expand_atomicrmw_singlethread_one_as(ptr addrspace(1) nocapture %arg) {
entry:
  %ret = atomicrmw fadd ptr addrspace(1) %arg, float 1.000000e+00 syncscope("singlethread-one-as") monotonic, align 4
  ret void
}

; GCN-LABEL: {{^}}expand_atomicrmw_one_as:
; GCN: global_atomic_cmpswap v{{[0-9]+}}, v[{{[0-9:]+}}], v[{{[0-9:]+}}], off glc{{$}}
define void @expand_atomicrmw_one_as(ptr addrspace(1) nocapture %arg) {
entry:
  %ret = atomicrmw fadd ptr addrspace(1) %arg, float 1.000000e+00 syncscope("one-as") monotonic, align 4
  ret void
}

; GCN-LABEL: {{^}}expand_atomicrmw_system:
; GCN: global_atomic_cmpswap v{{[0-9]+}}, v[{{[0-9:]+}}], v[{{[0-9:]+}}], off glc{{$}}
define void @expand_atomicrmw_system(ptr addrspace(1) nocapture %arg) {
entry:
  %ret = atomicrmw fadd ptr addrspace(1) %arg, float 1.000000e+00 monotonic, align 4
  ret void
}