[PowerPC] Generate Power9 extswsli extend sign and shift immediate instruction
[llvm-core.git] / test / CodeGen / AMDGPU / global_atomics_i64.ll
blobe63b5a9de2210a60de0ec3ef8c648c37ec2eea9b
1 ; RUN: llc -march=amdgcn -mcpu=bonaire -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,CI,CIVI %s
2 ; RUN: llc -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,VI,CIVI %s
3 ; RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,GFX9 %s
5 ; GCN-LABEL: {{^}}atomic_add_i64_offset:
6 ; CIVI: buffer_atomic_add_x2 v{{\[[0-9]+:[0-9]+\]}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:32{{$}}
8 ; GFX9: global_atomic_add_x2 v{{\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+}}:{{[0-9]+}}], off offset:32{{$}}
9 define amdgpu_kernel void @atomic_add_i64_offset(i64 addrspace(1)* %out, i64 %in) {
10 entry:
11   %gep = getelementptr i64, i64 addrspace(1)* %out, i64 4
12   %tmp0 = atomicrmw volatile add i64 addrspace(1)* %gep, i64 %in seq_cst
13   ret void
16 ; GCN-LABEL: {{^}}atomic_add_i64_ret_offset:
17 ; CIVI: buffer_atomic_add_x2 [[RET:v\[[0-9]+:[0-9]+\]]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:32 glc{{$}}
18 ; CIVI: buffer_store_dwordx2 [[RET]]
20 ; GFX9: global_atomic_add_x2 v{{\[[0-9]+:[0-9]+\]}}, v{{\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+}}:{{[0-9]+}}], off offset:32 glc{{$}}
21 define amdgpu_kernel void @atomic_add_i64_ret_offset(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in) {
22 entry:
23   %gep = getelementptr i64, i64 addrspace(1)* %out, i64 4
24   %tmp0 = atomicrmw volatile add i64 addrspace(1)* %gep, i64 %in seq_cst
25   store i64 %tmp0, i64 addrspace(1)* %out2
26   ret void
29 ; GCN-LABEL: {{^}}atomic_add_i64_addr64_offset:
30 ; CI: buffer_atomic_add_x2 v{{\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:32{{$}}
31 ; VI: flat_atomic_add_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}{{$}}
32 ; GFX9: global_atomic_add_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32{{$}}
33 define amdgpu_kernel void @atomic_add_i64_addr64_offset(i64 addrspace(1)* %out, i64 %in, i64 %index) {
34 entry:
35   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
36   %gep = getelementptr i64, i64 addrspace(1)* %ptr, i64 4
37   %tmp0 = atomicrmw volatile add i64 addrspace(1)* %gep, i64 %in seq_cst
38   ret void
41 ; GCN-LABEL: {{^}}atomic_add_i64_ret_addr64_offset:
42 ; CI: buffer_atomic_add_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:32 glc{{$}}
43 ; VI: flat_atomic_add_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
44 ; CIVI: buffer_store_dwordx2 [[RET]]
46 ; GFX9: global_atomic_add_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32 glc{{$}}
47 define amdgpu_kernel void @atomic_add_i64_ret_addr64_offset(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in, i64 %index) {
48 entry:
49   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
50   %gep = getelementptr i64, i64 addrspace(1)* %ptr, i64 4
51   %tmp0 = atomicrmw volatile add i64 addrspace(1)* %gep, i64 %in seq_cst
52   store i64 %tmp0, i64 addrspace(1)* %out2
53   ret void
56 ; GCN-LABEL: {{^}}atomic_add_i64:
57 ; SIVI: buffer_atomic_add_x2 v{{\[[0-9]+:[0-9]+\]}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
58 ; GFX9: global_atomic_add_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off{{$}}
59 define amdgpu_kernel void @atomic_add_i64(i64 addrspace(1)* %out, i64 %in) {
60 entry:
61   %tmp0 = atomicrmw volatile add i64 addrspace(1)* %out, i64 %in seq_cst
62   ret void
65 ; GCN-LABEL: {{^}}atomic_add_i64_ret:
66 ; CIVI: buffer_atomic_add_x2 [[RET:v\[[0-9]+:[0-9]+\]]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
67 ; CIVI: buffer_store_dwordx2 [[RET]]
69 ; GFX9: global_atomic_add_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off glc{{$}}
70 define amdgpu_kernel void @atomic_add_i64_ret(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in) {
71 entry:
72   %tmp0 = atomicrmw volatile add i64 addrspace(1)* %out, i64 %in seq_cst
73   store i64 %tmp0, i64 addrspace(1)* %out2
74   ret void
77 ; GCN-LABEL: {{^}}atomic_add_i64_addr64:
78 ; CI: buffer_atomic_add_x2 v{{\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
79 ; VI: flat_atomic_add_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
80 ; GFX9: global_atomic_add_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off{{$}}
81 define amdgpu_kernel void @atomic_add_i64_addr64(i64 addrspace(1)* %out, i64 %in, i64 %index) {
82 entry:
83   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
84   %tmp0 = atomicrmw volatile add i64 addrspace(1)* %ptr, i64 %in seq_cst
85   ret void
88 ; GCN-LABEL: {{^}}atomic_add_i64_ret_addr64:
89 ; CI: buffer_atomic_add_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
90 ; VI: flat_atomic_add_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
91 ; CIVI: buffer_store_dwordx2 [[RET]]
93 ; GFX9: global_atomic_add_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off glc{{$}}
94 define amdgpu_kernel void @atomic_add_i64_ret_addr64(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in, i64 %index) {
95 entry:
96   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
97   %tmp0 = atomicrmw volatile add i64 addrspace(1)* %ptr, i64 %in seq_cst
98   store i64 %tmp0, i64 addrspace(1)* %out2
99   ret void
102 ; GCN-LABEL: {{^}}atomic_and_i64_offset:
103 ; CIVI: buffer_atomic_and_x2 v{{\[[0-9]+:[0-9]+\]}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:32{{$}}
104 ; GFX9: global_atomic_and_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32{{$}}
105 define amdgpu_kernel void @atomic_and_i64_offset(i64 addrspace(1)* %out, i64 %in) {
106 entry:
107   %gep = getelementptr i64, i64 addrspace(1)* %out, i64 4
108   %tmp0 = atomicrmw volatile and i64 addrspace(1)* %gep, i64 %in seq_cst
109   ret void
112 ; GCN-LABEL: {{^}}atomic_and_i64_ret_offset:
113 ; CIVI: buffer_atomic_and_x2 [[RET:v\[[0-9]+:[0-9]+\]]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:32 glc{{$}}
114 ; CIVI: buffer_store_dwordx2 [[RET]]
116 ; GFX9: global_atomic_and_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32 glc{{$}}
117 define amdgpu_kernel void @atomic_and_i64_ret_offset(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in) {
118 entry:
119   %gep = getelementptr i64, i64 addrspace(1)* %out, i64 4
120   %tmp0 = atomicrmw volatile and i64 addrspace(1)* %gep, i64 %in seq_cst
121   store i64 %tmp0, i64 addrspace(1)* %out2
122   ret void
125 ; GCN-LABEL: {{^}}atomic_and_i64_addr64_offset:
126 ; CI: buffer_atomic_and_x2 v{{\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:32{{$}}
127 ; VI: flat_atomic_and_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
128 ; GFX9: global_atomic_and_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32{{$}}
129 define amdgpu_kernel void @atomic_and_i64_addr64_offset(i64 addrspace(1)* %out, i64 %in, i64 %index) {
130 entry:
131   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
132   %gep = getelementptr i64, i64 addrspace(1)* %ptr, i64 4
133   %tmp0 = atomicrmw volatile and i64 addrspace(1)* %gep, i64 %in seq_cst
134   ret void
137 ; GCN-LABEL: {{^}}atomic_and_i64_ret_addr64_offset:
138 ; CI: buffer_atomic_and_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:32 glc{{$}}
139 ; VI: flat_atomic_and_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
140 ; CIVI: buffer_store_dwordx2 [[RET]]
142 ; GFX9: global_atomic_and_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32 glc{{$}}
143 define amdgpu_kernel void @atomic_and_i64_ret_addr64_offset(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in, i64 %index) {
144 entry:
145   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
146   %gep = getelementptr i64, i64 addrspace(1)* %ptr, i64 4
147   %tmp0 = atomicrmw volatile and i64 addrspace(1)* %gep, i64 %in seq_cst
148   store i64 %tmp0, i64 addrspace(1)* %out2
149   ret void
152 ; GCN-LABEL: {{^}}atomic_and_i64:
153 ; CIVI: buffer_atomic_and_x2 v{{\[[0-9]+:[0-9]+\]}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
154 ; GFX9: global_atomic_and_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off{{$}}
155 define amdgpu_kernel void @atomic_and_i64(i64 addrspace(1)* %out, i64 %in) {
156 entry:
157   %tmp0 = atomicrmw volatile and i64 addrspace(1)* %out, i64 %in seq_cst
158   ret void
161 ; GCN-LABEL: {{^}}atomic_and_i64_ret:
162 ; CIVI: buffer_atomic_and_x2 [[RET:v\[[0-9]+:[0-9]+\]]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
163 ; CIVI: buffer_store_dwordx2 [[RET]]
165 ; GFX9: global_atomic_and_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off glc{{$}}
166 define amdgpu_kernel void @atomic_and_i64_ret(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in) {
167 entry:
168   %tmp0 = atomicrmw volatile and i64 addrspace(1)* %out, i64 %in seq_cst
169   store i64 %tmp0, i64 addrspace(1)* %out2
170   ret void
173 ; GCN-LABEL: {{^}}atomic_and_i64_addr64:
174 ; CI: buffer_atomic_and_x2 v{{\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
175 ; VI: flat_atomic_and_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
176 ; GFX9: global_atomic_and_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off{{$}}
177 define amdgpu_kernel void @atomic_and_i64_addr64(i64 addrspace(1)* %out, i64 %in, i64 %index) {
178 entry:
179   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
180   %tmp0 = atomicrmw volatile and i64 addrspace(1)* %ptr, i64 %in seq_cst
181   ret void
184 ; GCN-LABEL: {{^}}atomic_and_i64_ret_addr64:
185 ; CI: buffer_atomic_and_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
186 ; VI: flat_atomic_and_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
187 ; CIVI: buffer_store_dwordx2 [[RET]]
189 ; GFX9: global_atomic_and_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off glc{{$}}
190 define amdgpu_kernel void @atomic_and_i64_ret_addr64(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in, i64 %index) {
191 entry:
192   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
193   %tmp0 = atomicrmw volatile and i64 addrspace(1)* %ptr, i64 %in seq_cst
194   store i64 %tmp0, i64 addrspace(1)* %out2
195   ret void
198 ; GCN-LABEL: {{^}}atomic_sub_i64_offset:
199 ; CIVI: buffer_atomic_sub_x2 v{{\[[0-9]+:[0-9]+\]}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:32{{$}}
200 ; GFX9: global_atomic_sub_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32{{$}}
201 define amdgpu_kernel void @atomic_sub_i64_offset(i64 addrspace(1)* %out, i64 %in) {
202 entry:
203   %gep = getelementptr i64, i64 addrspace(1)* %out, i64 4
204   %tmp0 = atomicrmw volatile sub i64 addrspace(1)* %gep, i64 %in seq_cst
205   ret void
208 ; GCN-LABEL: {{^}}atomic_sub_i64_ret_offset:
209 ; CIVI: buffer_atomic_sub_x2 [[RET:v\[[0-9]+:[0-9]+\]]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:32 glc{{$}}
210 ; CIVI: buffer_store_dwordx2 [[RET]]
212 ; GFX9: global_atomic_sub_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32 glc{{$}}
213 define amdgpu_kernel void @atomic_sub_i64_ret_offset(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in) {
214 entry:
215   %gep = getelementptr i64, i64 addrspace(1)* %out, i64 4
216   %tmp0 = atomicrmw volatile sub i64 addrspace(1)* %gep, i64 %in seq_cst
217   store i64 %tmp0, i64 addrspace(1)* %out2
218   ret void
221 ; GCN-LABEL: {{^}}atomic_sub_i64_addr64_offset:
222 ; CI: buffer_atomic_sub_x2 v{{\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:32{{$}}
223 ; VI: flat_atomic_sub_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
224 ; GFX9: global_atomic_sub_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32{{$}}
225 define amdgpu_kernel void @atomic_sub_i64_addr64_offset(i64 addrspace(1)* %out, i64 %in, i64 %index) {
226 entry:
227   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
228   %gep = getelementptr i64, i64 addrspace(1)* %ptr, i64 4
229   %tmp0 = atomicrmw volatile sub i64 addrspace(1)* %gep, i64 %in seq_cst
230   ret void
233 ; GCN-LABEL: {{^}}atomic_sub_i64_ret_addr64_offset:
234 ; CI: buffer_atomic_sub_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:32 glc{{$}}
235 ; VI: flat_atomic_sub_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
236 ; CIVI: buffer_store_dwordx2 [[RET]]
238 ; GFX9: global_atomic_sub_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32 glc{{$}}
239 define amdgpu_kernel void @atomic_sub_i64_ret_addr64_offset(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in, i64 %index) {
240 entry:
241   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
242   %gep = getelementptr i64, i64 addrspace(1)* %ptr, i64 4
243   %tmp0 = atomicrmw volatile sub i64 addrspace(1)* %gep, i64 %in seq_cst
244   store i64 %tmp0, i64 addrspace(1)* %out2
245   ret void
248 ; GCN-LABEL: {{^}}atomic_sub_i64:
249 ; CIVI: buffer_atomic_sub_x2 v{{\[[0-9]+:[0-9]+\]}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
250 ; GFX9: global_atomic_sub_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off{{$}}
251 define amdgpu_kernel void @atomic_sub_i64(i64 addrspace(1)* %out, i64 %in) {
252 entry:
253   %tmp0 = atomicrmw volatile sub i64 addrspace(1)* %out, i64 %in seq_cst
254   ret void
257 ; GCN-LABEL: {{^}}atomic_sub_i64_ret:
258 ; CIVI: buffer_atomic_sub_x2 [[RET:v\[[0-9]+:[0-9]+\]]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
259 ; CIVI: buffer_store_dwordx2 [[RET]]
261 ; GFX9: global_atomic_sub_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off glc{{$}}
262 define amdgpu_kernel void @atomic_sub_i64_ret(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in) {
263 entry:
264   %tmp0 = atomicrmw volatile sub i64 addrspace(1)* %out, i64 %in seq_cst
265   store i64 %tmp0, i64 addrspace(1)* %out2
266   ret void
269 ; GCN-LABEL: {{^}}atomic_sub_i64_addr64:
270 ; CI: buffer_atomic_sub_x2 v{{\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
271 ; VI: flat_atomic_sub_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
272 ; GFX9: global_atomic_sub_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off{{$}}
273 define amdgpu_kernel void @atomic_sub_i64_addr64(i64 addrspace(1)* %out, i64 %in, i64 %index) {
274 entry:
275   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
276   %tmp0 = atomicrmw volatile sub i64 addrspace(1)* %ptr, i64 %in seq_cst
277   ret void
280 ; GCN-LABEL: {{^}}atomic_sub_i64_ret_addr64:
281 ; CI: buffer_atomic_sub_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
282 ; VI: flat_atomic_sub_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
283 ; CIVI: buffer_store_dwordx2 [[RET]]
285 ; GFX9: global_atomic_sub_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off glc{{$}}
286 define amdgpu_kernel void @atomic_sub_i64_ret_addr64(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in, i64 %index) {
287 entry:
288   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
289   %tmp0 = atomicrmw volatile sub i64 addrspace(1)* %ptr, i64 %in seq_cst
290   store i64 %tmp0, i64 addrspace(1)* %out2
291   ret void
294 ; GCN-LABEL: {{^}}atomic_max_i64_offset:
295 ; CIVI: buffer_atomic_smax_x2 v{{\[[0-9]+:[0-9]+\]}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:32{{$}}
296 ; GFX9: global_atomic_smax_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32{{$}}
297 define amdgpu_kernel void @atomic_max_i64_offset(i64 addrspace(1)* %out, i64 %in) {
298 entry:
299   %gep = getelementptr i64, i64 addrspace(1)* %out, i64 4
300   %tmp0 = atomicrmw volatile max i64 addrspace(1)* %gep, i64 %in seq_cst
301   ret void
304 ; GCN-LABEL: {{^}}atomic_max_i64_ret_offset:
305 ; CIVI: buffer_atomic_smax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:32 glc{{$}}
306 ; CIVI: buffer_store_dwordx2 [[RET]]
308 ; GFX9: global_atomic_smax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32 glc{{$}}
309 define amdgpu_kernel void @atomic_max_i64_ret_offset(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in) {
310 entry:
311   %gep = getelementptr i64, i64 addrspace(1)* %out, i64 4
312   %tmp0 = atomicrmw volatile max i64 addrspace(1)* %gep, i64 %in seq_cst
313   store i64 %tmp0, i64 addrspace(1)* %out2
314   ret void
317 ; GCN-LABEL: {{^}}atomic_max_i64_addr64_offset:
318 ; CI: buffer_atomic_smax_x2 v{{\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:32{{$}}
319 ; VI: flat_atomic_smax_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
320 ; GFX9: global_atomic_smax_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32{{$}}
321 define amdgpu_kernel void @atomic_max_i64_addr64_offset(i64 addrspace(1)* %out, i64 %in, i64 %index) {
322 entry:
323   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
324   %gep = getelementptr i64, i64 addrspace(1)* %ptr, i64 4
325   %tmp0 = atomicrmw volatile max i64 addrspace(1)* %gep, i64 %in seq_cst
326   ret void
329 ; GCN-LABEL: {{^}}atomic_max_i64_ret_addr64_offset:
330 ; CI: buffer_atomic_smax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:32 glc{{$}}
331 ; VI: flat_atomic_smax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
332 ; CIVI: buffer_store_dwordx2 [[RET]]
334 ; GFX9: global_atomic_smax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32 glc{{$}}
335 define amdgpu_kernel void @atomic_max_i64_ret_addr64_offset(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in, i64 %index) {
336 entry:
337   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
338   %gep = getelementptr i64, i64 addrspace(1)* %ptr, i64 4
339   %tmp0 = atomicrmw volatile max i64 addrspace(1)* %gep, i64 %in seq_cst
340   store i64 %tmp0, i64 addrspace(1)* %out2
341   ret void
344 ; GCN-LABEL: {{^}}atomic_max_i64:
345 ; CIVI: buffer_atomic_smax_x2 v{{\[[0-9]+:[0-9]+\]}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
346 ; GFX9: global_atomic_smax_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off{{$}}
347 define amdgpu_kernel void @atomic_max_i64(i64 addrspace(1)* %out, i64 %in) {
348 entry:
349   %tmp0 = atomicrmw volatile max i64 addrspace(1)* %out, i64 %in seq_cst
350   ret void
353 ; GCN-LABEL: {{^}}atomic_max_i64_ret:
354 ; CIVI: buffer_atomic_smax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
355 ; CIVI: buffer_store_dwordx2 [[RET]]
357 ; GFX9: global_atomic_smax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off glc{{$}}
358 define amdgpu_kernel void @atomic_max_i64_ret(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in) {
359 entry:
360   %tmp0 = atomicrmw volatile max i64 addrspace(1)* %out, i64 %in seq_cst
361   store i64 %tmp0, i64 addrspace(1)* %out2
362   ret void
365 ; GCN-LABEL: {{^}}atomic_max_i64_addr64:
366 ; CI: buffer_atomic_smax_x2 v{{\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
367 ; VI: flat_atomic_smax_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
368 ; GFX9: global_atomic_smax_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off{{$}}
369 define amdgpu_kernel void @atomic_max_i64_addr64(i64 addrspace(1)* %out, i64 %in, i64 %index) {
370 entry:
371   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
372   %tmp0 = atomicrmw volatile max i64 addrspace(1)* %ptr, i64 %in seq_cst
373   ret void
376 ; GCN-LABEL: {{^}}atomic_max_i64_ret_addr64:
377 ; CI: buffer_atomic_smax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
378 ; VI: flat_atomic_smax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
379 ; CIVI: buffer_store_dwordx2 [[RET]]
381 ; GFX9: global_atomic_smax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off glc{{$}}
382 define amdgpu_kernel void @atomic_max_i64_ret_addr64(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in, i64 %index) {
383 entry:
384   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
385   %tmp0 = atomicrmw volatile max i64 addrspace(1)* %ptr, i64 %in seq_cst
386   store i64 %tmp0, i64 addrspace(1)* %out2
387   ret void
390 ; GCN-LABEL: {{^}}atomic_umax_i64_offset:
391 ; CIVI: buffer_atomic_umax_x2 v{{\[[0-9]+:[0-9]+\]}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:32{{$}}
392 ; GFX9: global_atomic_umax_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32{{$}}
393 define amdgpu_kernel void @atomic_umax_i64_offset(i64 addrspace(1)* %out, i64 %in) {
394 entry:
395   %gep = getelementptr i64, i64 addrspace(1)* %out, i64 4
396   %tmp0 = atomicrmw volatile umax i64 addrspace(1)* %gep, i64 %in seq_cst
397   ret void
400 ; GCN-LABEL: {{^}}atomic_umax_i64_ret_offset:
401 ; CIVI: buffer_atomic_umax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:32 glc{{$}}
402 ; CIVI: buffer_store_dwordx2 [[RET]]
404 ; GFX9: global_atomic_umax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32 glc{{$}}
405 define amdgpu_kernel void @atomic_umax_i64_ret_offset(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in) {
406 entry:
407   %gep = getelementptr i64, i64 addrspace(1)* %out, i64 4
408   %tmp0 = atomicrmw volatile umax i64 addrspace(1)* %gep, i64 %in seq_cst
409   store i64 %tmp0, i64 addrspace(1)* %out2
410   ret void
413 ; GCN-LABEL: {{^}}atomic_umax_i64_addr64_offset:
414 ; CI: buffer_atomic_umax_x2 v{{\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:32{{$}}
415 ; VI: flat_atomic_umax_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
416 ; FX9: global_atomic_umax_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} offset:32{{$}}
417 define amdgpu_kernel void @atomic_umax_i64_addr64_offset(i64 addrspace(1)* %out, i64 %in, i64 %index) {
418 entry:
419   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
420   %gep = getelementptr i64, i64 addrspace(1)* %ptr, i64 4
421   %tmp0 = atomicrmw volatile umax i64 addrspace(1)* %gep, i64 %in seq_cst
422   ret void
425 ; GCN-LABEL: {{^}}atomic_umax_i64_ret_addr64_offset:
426 ; CI: buffer_atomic_umax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:32 glc{{$}}
427 ; VI: flat_atomic_umax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
428 ; CIVI: buffer_store_dwordx2 [[RET]]
430 ; GFX9: global_atomic_umax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32 glc{{$}}
431 define amdgpu_kernel void @atomic_umax_i64_ret_addr64_offset(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in, i64 %index) {
432 entry:
433   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
434   %gep = getelementptr i64, i64 addrspace(1)* %ptr, i64 4
435   %tmp0 = atomicrmw volatile umax i64 addrspace(1)* %gep, i64 %in seq_cst
436   store i64 %tmp0, i64 addrspace(1)* %out2
437   ret void
440 ; GCN-LABEL: {{^}}atomic_umax_i64:
441 ; CIVI: buffer_atomic_umax_x2 v{{\[[0-9]+:[0-9]+\]}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
442 ; GFX9: global_atomic_umax_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off{{$}}
443 define amdgpu_kernel void @atomic_umax_i64(i64 addrspace(1)* %out, i64 %in) {
444 entry:
445   %tmp0 = atomicrmw volatile umax i64 addrspace(1)* %out, i64 %in seq_cst
446   ret void
449 ; GCN-LABEL: {{^}}atomic_umax_i64_ret:
450 ; CIVI: buffer_atomic_umax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
451 ; CIVI: buffer_store_dwordx2 [[RET]]
453 ; GFX9: global_atomic_umax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off glc{{$}}
454 define amdgpu_kernel void @atomic_umax_i64_ret(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in) {
455 entry:
456   %tmp0 = atomicrmw volatile umax i64 addrspace(1)* %out, i64 %in seq_cst
457   store i64 %tmp0, i64 addrspace(1)* %out2
458   ret void
461 ; GCN-LABEL: {{^}}atomic_umax_i64_addr64:
462 ; CI: buffer_atomic_umax_x2 v{{\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
463 ; VI: flat_atomic_umax_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
464 ; GFX9: global_atomic_umax_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off{{$}}
465 define amdgpu_kernel void @atomic_umax_i64_addr64(i64 addrspace(1)* %out, i64 %in, i64 %index) {
466 entry:
467   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
468   %tmp0 = atomicrmw volatile umax i64 addrspace(1)* %ptr, i64 %in seq_cst
469   ret void
472 ; GCN-LABEL: {{^}}atomic_umax_i64_ret_addr64:
473 ; CI: buffer_atomic_umax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
474 ; VI: flat_atomic_umax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
475 ; CIVI: buffer_store_dwordx2 [[RET]]
477 ; GFX9: global_atomic_umax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off glc{{$}}
478 define amdgpu_kernel void @atomic_umax_i64_ret_addr64(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in, i64 %index) {
479 entry:
480   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
481   %tmp0 = atomicrmw volatile umax i64 addrspace(1)* %ptr, i64 %in seq_cst
482   store i64 %tmp0, i64 addrspace(1)* %out2
483   ret void
486 ; GCN-LABEL: {{^}}atomic_min_i64_offset:
487 ; CIVI: buffer_atomic_smin_x2 v{{\[[0-9]+:[0-9]+\]}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:32{{$}}
488 ; GFX9: global_atomic_smin_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32{{$}}
489 define amdgpu_kernel void @atomic_min_i64_offset(i64 addrspace(1)* %out, i64 %in) {
490 entry:
491   %gep = getelementptr i64, i64 addrspace(1)* %out, i64 4
492   %tmp0 = atomicrmw volatile min i64 addrspace(1)* %gep, i64 %in seq_cst
493   ret void
496 ; GCN-LABEL: {{^}}atomic_min_i64_ret_offset:
497 ; CIVI: buffer_atomic_smin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:32 glc{{$}}
498 ; CIVI: buffer_store_dwordx2 [[RET]]
500 ; GFX9: global_atomic_smin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32 glc{{$}}
501 define amdgpu_kernel void @atomic_min_i64_ret_offset(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in) {
502 entry:
503   %gep = getelementptr i64, i64 addrspace(1)* %out, i64 4
504   %tmp0 = atomicrmw volatile min i64 addrspace(1)* %gep, i64 %in seq_cst
505   store i64 %tmp0, i64 addrspace(1)* %out2
506   ret void
509 ; GCN-LABEL: {{^}}atomic_min_i64_addr64_offset:
510 ; CI: buffer_atomic_smin_x2 v{{\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:32{{$}}
511 ; VI: flat_atomic_smin_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
512 ; GFX9: global_atomic_smin_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32{{$}}
513 define amdgpu_kernel void @atomic_min_i64_addr64_offset(i64 addrspace(1)* %out, i64 %in, i64 %index) {
514 entry:
515   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
516   %gep = getelementptr i64, i64 addrspace(1)* %ptr, i64 4
517   %tmp0 = atomicrmw volatile min i64 addrspace(1)* %gep, i64 %in seq_cst
518   ret void
521 ; GCN-LABEL: {{^}}atomic_min_i64_ret_addr64_offset:
522 ; CI: buffer_atomic_smin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:32 glc{{$}}
523 ; VI: flat_atomic_smin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
524 ; CIVI: buffer_store_dwordx2 [[RET]]
526 ; GFX9: global_atomic_smin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32 glc{{$}}
527 define amdgpu_kernel void @atomic_min_i64_ret_addr64_offset(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in, i64 %index) {
528 entry:
529   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
530   %gep = getelementptr i64, i64 addrspace(1)* %ptr, i64 4
531   %tmp0 = atomicrmw volatile min i64 addrspace(1)* %gep, i64 %in seq_cst
532   store i64 %tmp0, i64 addrspace(1)* %out2
533   ret void
536 ; GCN-LABEL: {{^}}atomic_min_i64:
537 ; CIVI: buffer_atomic_smin_x2 v{{\[[0-9]+:[0-9]+\]}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
538 ; GFX9: global_atomic_smin_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off{{$}}
539 define amdgpu_kernel void @atomic_min_i64(i64 addrspace(1)* %out, i64 %in) {
540 entry:
541   %tmp0 = atomicrmw volatile min i64 addrspace(1)* %out, i64 %in seq_cst
542   ret void
545 ; GCN-LABEL: {{^}}atomic_min_i64_ret:
546 ; CIVI: buffer_atomic_smin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
547 ; CIVI: buffer_store_dwordx2 [[RET]]
549 ; GFX9: global_atomic_smin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off glc{{$}}
550 define amdgpu_kernel void @atomic_min_i64_ret(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in) {
551 entry:
552   %tmp0 = atomicrmw volatile min i64 addrspace(1)* %out, i64 %in seq_cst
553   store i64 %tmp0, i64 addrspace(1)* %out2
554   ret void
557 ; GCN-LABEL: {{^}}atomic_min_i64_addr64:
558 ; CI: buffer_atomic_smin_x2 v{{\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
559 ; VI: flat_atomic_smin_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
560 ; GFX9: global_atomic_smin_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off{{$}}
561 define amdgpu_kernel void @atomic_min_i64_addr64(i64 addrspace(1)* %out, i64 %in, i64 %index) {
562 entry:
563   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
564   %tmp0 = atomicrmw volatile min i64 addrspace(1)* %ptr, i64 %in seq_cst
565   ret void
568 ; GCN-LABEL: {{^}}atomic_min_i64_ret_addr64:
569 ; CI: buffer_atomic_smin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
570 ; VI: flat_atomic_smin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
571 ; CIVI: buffer_store_dwordx2 [[RET]]
573 ; GFX9: global_atomic_smin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off glc{{$}}
574 define amdgpu_kernel void @atomic_min_i64_ret_addr64(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in, i64 %index) {
575 entry:
576   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
577   %tmp0 = atomicrmw volatile min i64 addrspace(1)* %ptr, i64 %in seq_cst
578   store i64 %tmp0, i64 addrspace(1)* %out2
579   ret void
582 ; GCN-LABEL: {{^}}atomic_umin_i64_offset:
583 ; CIVI: buffer_atomic_umin_x2 v{{\[[0-9]+:[0-9]+\]}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:32{{$}}
585 ; GFX9: global_atomic_umin_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32{{$}}
586 define amdgpu_kernel void @atomic_umin_i64_offset(i64 addrspace(1)* %out, i64 %in) {
587 entry:
588   %gep = getelementptr i64, i64 addrspace(1)* %out, i64 4
589   %tmp0 = atomicrmw volatile umin i64 addrspace(1)* %gep, i64 %in seq_cst
590   ret void
593 ; GCN-LABEL: {{^}}atomic_umin_i64_ret_offset:
594 ; CIVI: buffer_atomic_umin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:32 glc{{$}}
595 ; CIVI: buffer_store_dwordx2 [[RET]]
597 ; GFX9: global_atomic_umin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32 glc{{$}}
598 define amdgpu_kernel void @atomic_umin_i64_ret_offset(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in) {
599 entry:
600   %gep = getelementptr i64, i64 addrspace(1)* %out, i64 4
601   %tmp0 = atomicrmw volatile umin i64 addrspace(1)* %gep, i64 %in seq_cst
602   store i64 %tmp0, i64 addrspace(1)* %out2
603   ret void
606 ; GCN-LABEL: {{^}}atomic_umin_i64_addr64_offset:
607 ; CI: buffer_atomic_umin_x2 v{{\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:32{{$}}
608 ; VI: flat_atomic_umin_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
609 ; GFX9: global_atomic_umin_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32{{$}}
610 define amdgpu_kernel void @atomic_umin_i64_addr64_offset(i64 addrspace(1)* %out, i64 %in, i64 %index) {
611 entry:
612   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
613   %gep = getelementptr i64, i64 addrspace(1)* %ptr, i64 4
614   %tmp0 = atomicrmw volatile umin i64 addrspace(1)* %gep, i64 %in seq_cst
615   ret void
618 ; GCN-LABEL: {{^}}atomic_umin_i64_ret_addr64_offset:
619 ; CI: buffer_atomic_umin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:32 glc{{$}}
620 ; VI: flat_atomic_umin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
621 ; CIVI: buffer_store_dwordx2 [[RET]]
623 ; GFX9: global_atomic_umin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32 glc{{$}}
624 define amdgpu_kernel void @atomic_umin_i64_ret_addr64_offset(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in, i64 %index) {
625 entry:
626   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
627   %gep = getelementptr i64, i64 addrspace(1)* %ptr, i64 4
628   %tmp0 = atomicrmw volatile umin i64 addrspace(1)* %gep, i64 %in seq_cst
629   store i64 %tmp0, i64 addrspace(1)* %out2
630   ret void
633 ; GCN-LABEL: {{^}}atomic_umin_i64:
634 ; CIVI: buffer_atomic_umin_x2 v{{\[[0-9]+:[0-9]+\]}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
635 ; GFX9: global_atomic_umin_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off{{$}}
636 define amdgpu_kernel void @atomic_umin_i64(i64 addrspace(1)* %out, i64 %in) {
637 entry:
638   %tmp0 = atomicrmw volatile umin i64 addrspace(1)* %out, i64 %in seq_cst
639   ret void
642 ; GCN-LABEL: {{^}}atomic_umin_i64_ret:
643 ; CIVI: buffer_atomic_umin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
644 ; CIVI: buffer_store_dwordx2 [[RET]]
646 ; GFX9: global_atomic_umin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off glc{{$}}
647 define amdgpu_kernel void @atomic_umin_i64_ret(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in) {
648 entry:
649   %tmp0 = atomicrmw volatile umin i64 addrspace(1)* %out, i64 %in seq_cst
650   store i64 %tmp0, i64 addrspace(1)* %out2
651   ret void
654 ; GCN-LABEL: {{^}}atomic_umin_i64_addr64:
655 ; CI: buffer_atomic_umin_x2 v{{\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
656 ; VI: flat_atomic_umin_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
657 ; GFX9: global_atomic_umin_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off{{$}}
658 define amdgpu_kernel void @atomic_umin_i64_addr64(i64 addrspace(1)* %out, i64 %in, i64 %index) {
659 entry:
660   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
661   %tmp0 = atomicrmw volatile umin i64 addrspace(1)* %ptr, i64 %in seq_cst
662   ret void
665 ; GCN-LABEL: {{^}}atomic_umin_i64_ret_addr64:
666 ; CI: buffer_atomic_umin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
667 ; VI: flat_atomic_umin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
668 ; CIVI: buffer_store_dwordx2 [[RET]]
670 ; GFX9: global_atomic_umin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off glc{{$}}
671 define amdgpu_kernel void @atomic_umin_i64_ret_addr64(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in, i64 %index) {
672 entry:
673   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
674   %tmp0 = atomicrmw volatile umin i64 addrspace(1)* %ptr, i64 %in seq_cst
675   store i64 %tmp0, i64 addrspace(1)* %out2
676   ret void
679 ; GCN-LABEL: {{^}}atomic_or_i64_offset:
680 ; CIVI: buffer_atomic_or_x2 v{{\[[0-9]+:[0-9]+\]}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:32{{$}}
681 ; GFX9: global_atomic_or_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32{{$}}
682 define amdgpu_kernel void @atomic_or_i64_offset(i64 addrspace(1)* %out, i64 %in) {
683 entry:
684   %gep = getelementptr i64, i64 addrspace(1)* %out, i64 4
685   %tmp0 = atomicrmw volatile or i64 addrspace(1)* %gep, i64 %in seq_cst
686   ret void
689 ; GCN-LABEL: {{^}}atomic_or_i64_ret_offset:
690 ; CIVI: buffer_atomic_or_x2 [[RET:v\[[0-9]+:[0-9]+\]]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:32 glc{{$}}
691 ; CIVI: buffer_store_dwordx2 [[RET]]
693 ; GFX9: global_atomic_or_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32 glc{{$}}
694 define amdgpu_kernel void @atomic_or_i64_ret_offset(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in) {
695 entry:
696   %gep = getelementptr i64, i64 addrspace(1)* %out, i64 4
697   %tmp0 = atomicrmw volatile or i64 addrspace(1)* %gep, i64 %in seq_cst
698   store i64 %tmp0, i64 addrspace(1)* %out2
699   ret void
702 ; GCN-LABEL: {{^}}atomic_or_i64_addr64_offset:
703 ; CI: buffer_atomic_or_x2 v{{\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:32{{$}}
704 ; VI: flat_atomic_or_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
705 ; GFX9: global_atomic_or_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32{{$}}
706 define amdgpu_kernel void @atomic_or_i64_addr64_offset(i64 addrspace(1)* %out, i64 %in, i64 %index) {
707 entry:
708   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
709   %gep = getelementptr i64, i64 addrspace(1)* %ptr, i64 4
710   %tmp0 = atomicrmw volatile or i64 addrspace(1)* %gep, i64 %in seq_cst
711   ret void
714 ; GCN-LABEL: {{^}}atomic_or_i64_ret_addr64_offset:
715 ; CI: buffer_atomic_or_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:32 glc{{$}}
716 ; VI: flat_atomic_or_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
717 ; CIVI: buffer_store_dwordx2 [[RET]]
719 ; GFX9: global_atomic_or_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32 glc{{$}}
720 define amdgpu_kernel void @atomic_or_i64_ret_addr64_offset(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in, i64 %index) {
721 entry:
722   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
723   %gep = getelementptr i64, i64 addrspace(1)* %ptr, i64 4
724   %tmp0 = atomicrmw volatile or i64 addrspace(1)* %gep, i64 %in seq_cst
725   store i64 %tmp0, i64 addrspace(1)* %out2
726   ret void
729 ; GCN-LABEL: {{^}}atomic_or_i64:
730 ; CIVI: buffer_atomic_or_x2 v{{\[[0-9]+:[0-9]+\]}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
731 ; GFX9: global_atomic_or_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off{{$}}
732 define amdgpu_kernel void @atomic_or_i64(i64 addrspace(1)* %out, i64 %in) {
733 entry:
734   %tmp0 = atomicrmw volatile or i64 addrspace(1)* %out, i64 %in seq_cst
735   ret void
738 ; GCN-LABEL: {{^}}atomic_or_i64_ret:
739 ; CIVI: buffer_atomic_or_x2 [[RET:v\[[0-9]+:[0-9]+\]]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
740 ; CIVI: buffer_store_dwordx2 [[RET]]
742 ; GFX9: global_atomic_or_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off glc{{$}}
743 define amdgpu_kernel void @atomic_or_i64_ret(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in) {
744 entry:
745   %tmp0 = atomicrmw volatile or i64 addrspace(1)* %out, i64 %in seq_cst
746   store i64 %tmp0, i64 addrspace(1)* %out2
747   ret void
750 ; GCN-LABEL: {{^}}atomic_or_i64_addr64:
751 ; CI: buffer_atomic_or_x2 v{{\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
752 ; VI: flat_atomic_or_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
753 ; GFX9: global_atomic_or_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off{{$}}
754 define amdgpu_kernel void @atomic_or_i64_addr64(i64 addrspace(1)* %out, i64 %in, i64 %index) {
755 entry:
756   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
757   %tmp0 = atomicrmw volatile or i64 addrspace(1)* %ptr, i64 %in seq_cst
758   ret void
761 ; GCN-LABEL: {{^}}atomic_or_i64_ret_addr64:
762 ; CI: buffer_atomic_or_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
763 ; VI: flat_atomic_or_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
764 ; CIVI: buffer_store_dwordx2 [[RET]]
766 ; GFX9: global_atomic_or_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off glc{{$}}
767 define amdgpu_kernel void @atomic_or_i64_ret_addr64(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in, i64 %index) {
768 entry:
769   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
770   %tmp0 = atomicrmw volatile or i64 addrspace(1)* %ptr, i64 %in seq_cst
771   store i64 %tmp0, i64 addrspace(1)* %out2
772   ret void
775 ; GCN-LABEL: {{^}}atomic_xchg_i64_offset:
776 ; CIVI: buffer_atomic_swap_x2 v{{\[[0-9]+:[0-9]+\]}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:32{{$}}
778 ; GFX9: global_atomic_swap_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32{{$}}
779 define amdgpu_kernel void @atomic_xchg_i64_offset(i64 addrspace(1)* %out, i64 %in) {
780 entry:
781   %gep = getelementptr i64, i64 addrspace(1)* %out, i64 4
782   %tmp0 = atomicrmw volatile xchg i64 addrspace(1)* %gep, i64 %in seq_cst
783   ret void
786 ; GCN-LABEL: {{^}}atomic_xchg_i64_ret_offset:
787 ; CIVI: buffer_atomic_swap_x2 [[RET:v\[[0-9]+:[0-9]+\]]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:32 glc{{$}}
788 ; CIVI: buffer_store_dwordx2 [[RET]]
790 ; GFX9: global_atomic_swap_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32 glc{{$}}
791 define amdgpu_kernel void @atomic_xchg_i64_ret_offset(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in) {
792 entry:
793   %gep = getelementptr i64, i64 addrspace(1)* %out, i64 4
794   %tmp0 = atomicrmw volatile xchg i64 addrspace(1)* %gep, i64 %in seq_cst
795   store i64 %tmp0, i64 addrspace(1)* %out2
796   ret void
799 ; GCN-LABEL: {{^}}atomic_xchg_i64_addr64_offset:
800 ; CI: buffer_atomic_swap_x2 v{{\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:32{{$}}
801 ; VI: flat_atomic_swap_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}{{$}}
802 ; GFX9: global_atomic_swap_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32{{$}}
803 define amdgpu_kernel void @atomic_xchg_i64_addr64_offset(i64 addrspace(1)* %out, i64 %in, i64 %index) {
804 entry:
805   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
806   %gep = getelementptr i64, i64 addrspace(1)* %ptr, i64 4
807   %tmp0 = atomicrmw volatile xchg i64 addrspace(1)* %gep, i64 %in seq_cst
808   ret void
811 ; GCN-LABEL: {{^}}atomic_xchg_i64_ret_addr64_offset:
812 ; CI: buffer_atomic_swap_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:32 glc{{$}}
813 ; VI: flat_atomic_swap_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
814 ; CIVI: buffer_store_dwordx2 [[RET]]
816 ; GFX9: global_atomic_swap_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32 glc{{$}}
817 define amdgpu_kernel void @atomic_xchg_i64_ret_addr64_offset(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in, i64 %index) {
818 entry:
819   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
820   %gep = getelementptr i64, i64 addrspace(1)* %ptr, i64 4
821   %tmp0 = atomicrmw volatile xchg i64 addrspace(1)* %gep, i64 %in seq_cst
822   store i64 %tmp0, i64 addrspace(1)* %out2
823   ret void
826 ; GCN-LABEL: {{^}}atomic_xchg_i64:
827 ; CIVI: buffer_atomic_swap_x2 v{{\[[0-9]+:[0-9]+\]}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
828 ; GFX9: global_atomic_swap_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off{{$}}
829 define amdgpu_kernel void @atomic_xchg_i64(i64 addrspace(1)* %out, i64 %in) {
830 entry:
831   %tmp0 = atomicrmw volatile xchg i64 addrspace(1)* %out, i64 %in seq_cst
832   ret void
835 ; GCN-LABEL: {{^}}atomic_xchg_i64_ret:
836 ; CIVI: buffer_atomic_swap_x2 [[RET:v\[[0-9]+:[0-9]+\]]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
837 ; CIVI: buffer_store_dwordx2 [[RET]]
839 ; GFX9: global_atomic_swap_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off glc{{$}}
840 define amdgpu_kernel void @atomic_xchg_i64_ret(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in) {
841 entry:
842   %tmp0 = atomicrmw volatile xchg i64 addrspace(1)* %out, i64 %in seq_cst
843   store i64 %tmp0, i64 addrspace(1)* %out2
844   ret void
847 ; GCN-LABEL: {{^}}atomic_xchg_i64_addr64:
848 ; CI: buffer_atomic_swap_x2 v{{\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
849 ; VI: flat_atomic_swap_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
850 ; GFX9: global_atomic_swap_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off{{$}}
851 define amdgpu_kernel void @atomic_xchg_i64_addr64(i64 addrspace(1)* %out, i64 %in, i64 %index) {
852 entry:
853   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
854   %tmp0 = atomicrmw volatile xchg i64 addrspace(1)* %ptr, i64 %in seq_cst
855   ret void
858 ; GCN-LABEL: {{^}}atomic_xchg_i64_ret_addr64:
859 ; CI: buffer_atomic_swap_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
860 ; VI: flat_atomic_swap_x2 [[RET:v\[[0-9]+:[0-9]+\]]],  v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
861 ; CIVI: buffer_store_dwordx2 [[RET]]
863 ; GFX9: global_atomic_swap_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off glc{{$}}
864 define amdgpu_kernel void @atomic_xchg_i64_ret_addr64(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in, i64 %index) {
865 entry:
866   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
867   %tmp0 = atomicrmw volatile xchg i64 addrspace(1)* %ptr, i64 %in seq_cst
868   store i64 %tmp0, i64 addrspace(1)* %out2
869   ret void
872 ; GCN-LABEL: {{^}}atomic_xor_i64_offset:
873 ; CIVI: buffer_atomic_xor_x2 v{{\[[0-9]+:[0-9]+\]}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:32{{$}}
874 ; GFX9: global_atomic_xor_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32{{$}}
875 define amdgpu_kernel void @atomic_xor_i64_offset(i64 addrspace(1)* %out, i64 %in) {
876 entry:
877   %gep = getelementptr i64, i64 addrspace(1)* %out, i64 4
878   %tmp0 = atomicrmw volatile xor i64 addrspace(1)* %gep, i64 %in seq_cst
879   ret void
882 ; GCN-LABEL: {{^}}atomic_xor_i64_ret_offset:
883 ; CIVI: buffer_atomic_xor_x2 [[RET:v\[[0-9]+:[0-9]+\]]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:32 glc{{$}}
884 ; CIVI: buffer_store_dwordx2 [[RET]]
886 ; GFX9: global_atomic_xor_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32 glc{{$}}
887 define amdgpu_kernel void @atomic_xor_i64_ret_offset(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in) {
888 entry:
889   %gep = getelementptr i64, i64 addrspace(1)* %out, i64 4
890   %tmp0 = atomicrmw volatile xor i64 addrspace(1)* %gep, i64 %in seq_cst
891   store i64 %tmp0, i64 addrspace(1)* %out2
892   ret void
895 ; GCN-LABEL: {{^}}atomic_xor_i64_addr64_offset:
896 ; CI: buffer_atomic_xor_x2 v{{\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:32{{$}}
897 ; VI: flat_atomic_xor_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
898 ; GFX9: global_atomic_xor_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32{{$}}
899 define amdgpu_kernel void @atomic_xor_i64_addr64_offset(i64 addrspace(1)* %out, i64 %in, i64 %index) {
900 entry:
901   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
902   %gep = getelementptr i64, i64 addrspace(1)* %ptr, i64 4
903   %tmp0 = atomicrmw volatile xor i64 addrspace(1)* %gep, i64 %in seq_cst
904   ret void
907 ; GCN-LABEL: {{^}}atomic_xor_i64_ret_addr64_offset:
908 ; CI: buffer_atomic_xor_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:32 glc{{$}}
909 ; VI: flat_atomic_xor_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
910 ; CIVI: buffer_store_dwordx2 [[RET]]
912 ; GFX9: global_atomic_xor_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32 glc{{$}}
913 define amdgpu_kernel void @atomic_xor_i64_ret_addr64_offset(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in, i64 %index) {
914 entry:
915   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
916   %gep = getelementptr i64, i64 addrspace(1)* %ptr, i64 4
917   %tmp0 = atomicrmw volatile xor i64 addrspace(1)* %gep, i64 %in seq_cst
918   store i64 %tmp0, i64 addrspace(1)* %out2
919   ret void
922 ; GCN-LABEL: {{^}}atomic_xor_i64:
923 ; CIVI: buffer_atomic_xor_x2 v{{\[[0-9]+:[0-9]+\]}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
924 ; GFX9: global_atomic_xor_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off{{$}}
925 define amdgpu_kernel void @atomic_xor_i64(i64 addrspace(1)* %out, i64 %in) {
926 entry:
927   %tmp0 = atomicrmw volatile xor i64 addrspace(1)* %out, i64 %in seq_cst
928   ret void
931 ; GCN-LABEL: {{^}}atomic_xor_i64_ret:
932 ; CIVI: buffer_atomic_xor_x2 [[RET:v\[[0-9]+:[0-9]+\]]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
933 ; CIVI: buffer_store_dwordx2 [[RET]]
935 ; GFX9: global_atomic_xor_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off glc{{$}}
936 define amdgpu_kernel void @atomic_xor_i64_ret(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in) {
937 entry:
938   %tmp0 = atomicrmw volatile xor i64 addrspace(1)* %out, i64 %in seq_cst
939   store i64 %tmp0, i64 addrspace(1)* %out2
940   ret void
943 ; GCN-LABEL: {{^}}atomic_xor_i64_addr64:
944 ; CI: buffer_atomic_xor_x2 v{{\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
945 ; VI: flat_atomic_xor_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
946 ; GFX9: global_atomic_xor_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off{{$}}
947 define amdgpu_kernel void @atomic_xor_i64_addr64(i64 addrspace(1)* %out, i64 %in, i64 %index) {
948 entry:
949   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
950   %tmp0 = atomicrmw volatile xor i64 addrspace(1)* %ptr, i64 %in seq_cst
951   ret void
954 ; GCN-LABEL: {{^}}atomic_xor_i64_ret_addr64:
955 ; CI: buffer_atomic_xor_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
956 ; VI: flat_atomic_xor_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
957 ; CIVI: buffer_store_dwordx2 [[RET]]
959 ; GFX9: global_atomic_xor_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off glc{{$}}
960 define amdgpu_kernel void @atomic_xor_i64_ret_addr64(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in, i64 %index) {
961 entry:
962   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
963   %tmp0 = atomicrmw volatile xor i64 addrspace(1)* %ptr, i64 %in seq_cst
964   store i64 %tmp0, i64 addrspace(1)* %out2
965   ret void
969 ; GCN-LABEL: {{^}}atomic_cmpxchg_i64_offset:
970 ; CIVI: buffer_atomic_cmpswap_x2 v[{{[0-9]+}}:{{[0-9]+}}], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:32{{$}}
971 ; GFX9: global_atomic_cmpswap_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32{{$}}
972 define amdgpu_kernel void @atomic_cmpxchg_i64_offset(i64 addrspace(1)* %out, i64 %in, i64 %old) {
973 entry:
974   %gep = getelementptr i64, i64 addrspace(1)* %out, i64 4
975   %val = cmpxchg volatile i64 addrspace(1)* %gep, i64 %old, i64 %in seq_cst seq_cst
976   ret void
979 ; GCN-LABEL: {{^}}atomic_cmpxchg_i64_soffset:
980 ; CIVI: s_mov_b32 [[SREG:s[0-9]+]], 0x11940
981 ; CIVI: buffer_atomic_cmpswap_x2 v[{{[0-9]+}}:{{[0-9]+}}], off, s[{{[0-9]+}}:{{[0-9]+}}], [[SREG]]{{$}}
983 ; GFX9: global_atomic_cmpswap_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off{{$}}
984 define amdgpu_kernel void @atomic_cmpxchg_i64_soffset(i64 addrspace(1)* %out, i64 %in, i64 %old) {
985 entry:
986   %gep = getelementptr i64, i64 addrspace(1)* %out, i64 9000
987   %val = cmpxchg volatile i64 addrspace(1)* %gep, i64 %old, i64 %in seq_cst seq_cst
988   ret void
991 ; GCN-LABEL: {{^}}atomic_cmpxchg_i64_ret_offset:
992 ; CIVI: buffer_atomic_cmpswap_x2 v{{\[}}[[RET:[0-9]+]]{{:[0-9]+}}], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:32 glc{{$}}
993 ; CIVI: buffer_store_dwordx2 v{{\[}}[[RET]]:
995 ; GFX9: global_atomic_cmpswap_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}, off offset:32 glc{{$}}
996 define amdgpu_kernel void @atomic_cmpxchg_i64_ret_offset(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in, i64 %old) {
997 entry:
998   %gep = getelementptr i64, i64 addrspace(1)* %out, i64 4
999   %val = cmpxchg volatile i64 addrspace(1)* %gep, i64 %old, i64 %in seq_cst seq_cst
1000   %extract0 = extractvalue { i64, i1 } %val, 0
1001   store i64 %extract0, i64 addrspace(1)* %out2
1002   ret void
1005 ; GCN-LABEL: {{^}}atomic_cmpxchg_i64_addr64_offset:
1006 ; CI: buffer_atomic_cmpswap_x2 v[{{[0-9]+\:[0-9]+}}], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:32{{$}}
1007 ; VI: flat_atomic_cmpswap_x2 v[{{[0-9]+\:[0-9]+}}], v[{{[0-9]+}}:{{[0-9]+}}]{{$}}
1008 ; GFX9: global_atomic_cmpswap_x2 v[{{[0-9]+\:[0-9]+}}], v[{{[0-9]+}}:{{[0-9]+}}], off offset:32{{$}}
1009 define amdgpu_kernel void @atomic_cmpxchg_i64_addr64_offset(i64 addrspace(1)* %out, i64 %in, i64 %index, i64 %old) {
1010 entry:
1011   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
1012   %gep = getelementptr i64, i64 addrspace(1)* %ptr, i64 4
1013   %val = cmpxchg volatile i64 addrspace(1)* %gep, i64 %old, i64 %in seq_cst seq_cst
1014   ret void
1017 ; GCN-LABEL: {{^}}atomic_cmpxchg_i64_ret_addr64_offset:
1018 ; CI: buffer_atomic_cmpswap_x2 v{{\[}}[[RET:[0-9]+]]:{{[0-9]+}}], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:32 glc{{$}}
1019 ; VI: flat_atomic_cmpswap_x2 v{{\[}}[[RET:[0-9]+]]:{{[0-9]+\]}}, v[{{[0-9]+:[0-9]+}}], v[{{[0-9]+:[0-9]+}}] glc{{$}}
1020 ; CIVI: buffer_store_dwordx2 v{{\[}}[[RET]]:
1022 ; GFX9: global_atomic_cmpswap_x2 v{{\[}}[[RET:[0-9]+]]:{{[0-9]+\]}}, v[{{[0-9]+:[0-9]+}}], v[{{[0-9]+:[0-9]+}}], off offset:32 glc{{$}}
1023 define amdgpu_kernel void @atomic_cmpxchg_i64_ret_addr64_offset(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in, i64 %index, i64 %old) {
1024 entry:
1025   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
1026   %gep = getelementptr i64, i64 addrspace(1)* %ptr, i64 4
1027   %val = cmpxchg volatile i64 addrspace(1)* %gep, i64 %old, i64 %in seq_cst seq_cst
1028   %extract0 = extractvalue { i64, i1 } %val, 0
1029   store i64 %extract0, i64 addrspace(1)* %out2
1030   ret void
1033 ; GCN-LABEL: {{^}}atomic_cmpxchg_i64:
1034 ; CIVI: buffer_atomic_cmpswap_x2 v[{{[0-9]+:[0-9]+}}], off, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
1035 ; GFX9: global_atomic_cmpswap_x2 v[{{[0-9]+:[0-9]+}}], v[{{[0-9]+:[0-9]+}}], off{{$}}
1036 define amdgpu_kernel void @atomic_cmpxchg_i64(i64 addrspace(1)* %out, i64 %in, i64 %old) {
1037 entry:
1038   %val = cmpxchg volatile i64 addrspace(1)* %out, i64 %old, i64 %in seq_cst seq_cst
1039   ret void
1042 ; GCN-LABEL: {{^}}atomic_cmpxchg_i64_ret:
1043 ; CIVI: buffer_atomic_cmpswap_x2 v{{\[}}[[RET:[0-9]+]]:{{[0-9]+}}], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
1044 ; CIVI: buffer_store_dwordx2 v{{\[}}[[RET]]:
1046 ; GFX9: global_atomic_cmpswap_x2 v{{\[}}[[RET:[0-9]+]]:{{[0-9]+\]}}, v[{{[0-9]+:[0-9]+}}], v[{{[0-9]+:[0-9]+}}], off glc{{$}}
1047 define amdgpu_kernel void @atomic_cmpxchg_i64_ret(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in, i64 %old) {
1048 entry:
1049   %val = cmpxchg volatile i64 addrspace(1)* %out, i64 %old, i64 %in seq_cst seq_cst
1050   %extract0 = extractvalue { i64, i1 } %val, 0
1051   store i64 %extract0, i64 addrspace(1)* %out2
1052   ret void
1055 ; GCN-LABEL: {{^}}atomic_cmpxchg_i64_addr64:
1056 ; CI: buffer_atomic_cmpswap_x2 v[{{[0-9]+:[0-9]+}}], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
1057 ; VI: flat_atomic_cmpswap_x2 v[{{[0-9]+:[0-9]+}}], v[{{[0-9]+:[0-9]+}}]{{$}}
1058 ; GFX9: global_atomic_cmpswap_x2 v[{{[0-9]+:[0-9]+}}], v[{{[0-9]+:[0-9]+}}], off{{$}}
1059 define amdgpu_kernel void @atomic_cmpxchg_i64_addr64(i64 addrspace(1)* %out, i64 %in, i64 %index, i64 %old) {
1060 entry:
1061   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
1062   %val = cmpxchg volatile i64 addrspace(1)* %ptr, i64 %old, i64 %in seq_cst seq_cst
1063   ret void
1066 ; GCN-LABEL: {{^}}atomic_cmpxchg_i64_ret_addr64:
1067 ; CI: buffer_atomic_cmpswap_x2 v{{\[}}[[RET:[0-9]+]]:{{[0-9]+}}], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
1068 ; VI: flat_atomic_cmpswap_x2 v{{\[}}[[RET:[0-9]+]]:{{[0-9]+\]}}, v[{{[0-9]+:[0-9]+}}], v[{{[0-9]+:[0-9]+}}] glc{{$}}
1069 ; CIVI: buffer_store_dwordx2 v{{\[}}[[RET]]:
1071 ; GFX9: global_atomic_cmpswap_x2 v{{\[}}[[RET:[0-9]+]]:{{[0-9]+\]}}, v[{{[0-9]+:[0-9]+}}], v[{{[0-9]+:[0-9]+}}], off glc{{$}}
1072 define amdgpu_kernel void @atomic_cmpxchg_i64_ret_addr64(i64 addrspace(1)* %out, i64 addrspace(1)* %out2, i64 %in, i64 %index, i64 %old) {
1073 entry:
1074   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
1075   %val = cmpxchg volatile i64 addrspace(1)* %ptr, i64 %old, i64 %in seq_cst seq_cst
1076   %extract0 = extractvalue { i64, i1 } %val, 0
1077   store i64 %extract0, i64 addrspace(1)* %out2
1078   ret void
1081 ; GCN-LABEL: {{^}}atomic_load_i64_offset:
1082 ; CI: buffer_load_dwordx2 [[RET:v\[[0-9]+:[0-9]+\]]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:32 glc{{$}}
1083 ; VI: flat_load_dwordx2 [[RET:v\[[0-9]+:[0-9]\]]], v[{{[0-9]+}}:{{[0-9]+}}] glc{{$}}
1084 ; CIVI: buffer_store_dwordx2 [[RET]]
1086 ; GFX9: global_load_dwordx2 [[RET:v\[[0-9]+:[0-9]\]]], v[{{[0-9]+}}:{{[0-9]+}}], off offset:32 glc{{$}}
1087 define amdgpu_kernel void @atomic_load_i64_offset(i64 addrspace(1)* %in, i64 addrspace(1)* %out) {
1088 entry:
1089   %gep = getelementptr i64, i64 addrspace(1)* %in, i64 4
1090   %val = load atomic i64, i64 addrspace(1)* %gep  seq_cst, align 8
1091   store i64 %val, i64 addrspace(1)* %out
1092   ret void
1095 ; GCN-LABEL: {{^}}atomic_load_i64:
1096 ; CI: buffer_load_dwordx2 [[RET:v\[[0-9]+:[0-9]\]]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
1097 ; VI: flat_load_dwordx2 [[RET:v\[[0-9]+:[0-9]\]]], v[{{[0-9]+}}:{{[0-9]+}}] glc
1098 ; CIVI: buffer_store_dwordx2 [[RET]]
1100 ; GFX9: global_load_dwordx2 [[RET:v\[[0-9]+:[0-9]\]]], v[{{[0-9]+}}:{{[0-9]+}}], off glc{{$}}
1101 define amdgpu_kernel void @atomic_load_i64(i64 addrspace(1)* %in, i64 addrspace(1)* %out) {
1102 entry:
1103   %val = load atomic i64, i64 addrspace(1)* %in seq_cst, align 8
1104   store i64 %val, i64 addrspace(1)* %out
1105   ret void
1108 ; GCN-LABEL: {{^}}atomic_load_i64_addr64_offset:
1109 ; CI: buffer_load_dwordx2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:32 glc{{$}}
1110 ; VI: flat_load_dwordx2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}] glc{{$}}
1111 ; CIVI: buffer_store_dwordx2 [[RET]]
1113 ; GFX9: global_load_dwordx2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], off offset:32 glc{{$}}
1114 define amdgpu_kernel void @atomic_load_i64_addr64_offset(i64 addrspace(1)* %in, i64 addrspace(1)* %out, i64 %index) {
1115 entry:
1116   %ptr = getelementptr i64, i64 addrspace(1)* %in, i64 %index
1117   %gep = getelementptr i64, i64 addrspace(1)* %ptr, i64 4
1118   %val = load atomic i64, i64 addrspace(1)* %gep seq_cst, align 8
1119   store i64 %val, i64 addrspace(1)* %out
1120   ret void
1123 ; GCN-LABEL: {{^}}atomic_load_i64_addr64:
1124 ; CI: buffer_load_dwordx2 [[RET:v\[[0-9]+:[0-9]\]]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
1125 ; VI: flat_load_dwordx2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}] glc{{$}}
1126 ; CIVI: buffer_store_dwordx2 [[RET]]
1128 ; GFX9: global_load_dwordx2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], off glc{{$}}
1129 define amdgpu_kernel void @atomic_load_i64_addr64(i64 addrspace(1)* %in, i64 addrspace(1)* %out, i64 %index) {
1130 entry:
1131   %ptr = getelementptr i64, i64 addrspace(1)* %in, i64 %index
1132   %val = load atomic i64, i64 addrspace(1)* %ptr seq_cst, align 8
1133   store i64 %val, i64 addrspace(1)* %out
1134   ret void
1137 ; GCN-LABEL: {{^}}atomic_store_i64_offset:
1138 ; CI: buffer_store_dwordx2 [[RET:v\[[0-9]+:[0-9]+\]]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:32{{$}}
1139 ; VI: flat_store_dwordx2 [[RET:v\[[0-9]+:[0-9]\]]], v[{{[0-9]+}}:{{[0-9]+}}]{{$}}
1140 ; GFX9: global_store_dwordx2 [[RET:v\[[0-9]+:[0-9]\]]], v[{{[0-9]+}}:{{[0-9]+}}], off offset:32{{$}}
1141 define amdgpu_kernel void @atomic_store_i64_offset(i64 %in, i64 addrspace(1)* %out) {
1142 entry:
1143   %gep = getelementptr i64, i64 addrspace(1)* %out, i64 4
1144   store atomic i64 %in, i64 addrspace(1)* %gep  seq_cst, align 8
1145   ret void
1148 ; GCN-LABEL: {{^}}atomic_store_i64:
1149 ; CI: buffer_store_dwordx2 {{v\[[0-9]+:[0-9]\]}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
1150 ; VI: flat_store_dwordx2 {{v\[[0-9]+:[0-9]\]}}, v[{{[0-9]+}}:{{[0-9]+}}]{{$}}
1151 ; GFX9: global_store_dwordx2 {{v\[[0-9]+:[0-9]\]}}, v[{{[0-9]+}}:{{[0-9]+}}], off{{$}}
1152 define amdgpu_kernel void @atomic_store_i64(i64 %in, i64 addrspace(1)* %out) {
1153 entry:
1154   store atomic i64 %in, i64 addrspace(1)* %out seq_cst, align 8
1155   ret void
1158 ; GCN-LABEL: {{^}}atomic_store_i64_addr64_offset:
1159 ; CI: buffer_store_dwordx2 {{v\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:32{{$}}
1160 ; VI: flat_store_dwordx2 {{v\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+:[0-9]+}}]{{$}}
1161 ; GFX9: global_store_dwordx2 {{v\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+:[0-9]+}}], off offset:32{{$}}
1162 define amdgpu_kernel void @atomic_store_i64_addr64_offset(i64 %in, i64 addrspace(1)* %out, i64 %index) {
1163 entry:
1164   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
1165   %gep = getelementptr i64, i64 addrspace(1)* %ptr, i64 4
1166   store atomic i64 %in, i64 addrspace(1)* %gep seq_cst, align 8
1167   ret void
1170 ; GCN-LABEL: {{^}}atomic_store_i64_addr64:
1171 ; CI: buffer_store_dwordx2 {{v\[[0-9]+:[0-9]\]}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
1172 ; VI: flat_store_dwordx2 {{v\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+:[0-9]+}}]{{$}}
1173 ; GFX9: global_store_dwordx2 {{v\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+:[0-9]+}}], off{{$}}
1174 define amdgpu_kernel void @atomic_store_i64_addr64(i64 %in, i64 addrspace(1)* %out, i64 %index) {
1175 entry:
1176   %ptr = getelementptr i64, i64 addrspace(1)* %out, i64 %index
1177   store atomic i64 %in, i64 addrspace(1)* %ptr seq_cst, align 8
1178   ret void