1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O2 -mtriple=amdgcn -mcpu=gfx1100 -run-pass=si-insert-waitcnts -verify-machineinstrs -o - %s | FileCheck %s -check-prefixes=CHECK,OPT
3 # RUN: llc -O0 -mtriple=amdgcn -mcpu=gfx1100 -run-pass=si-insert-waitcnts -verify-machineinstrs -o - %s | FileCheck %s -check-prefixes=CHECK,NOOPT
6 define amdgpu_ps void @tbuffer_store1() { ret void }
7 define amdgpu_ps void @tbuffer_store2() { ret void }
8 define amdgpu_ps void @flat_store() { ret void }
9 define amdgpu_ps void @global_store() { ret void }
10 define amdgpu_ps void @buffer_store_format() { ret void }
11 define amdgpu_ps void @ds_write_b32() { ret void }
12 define amdgpu_ps void @global_store_dword() { ret void }
13 define amdgpu_ps void @multiple_basic_blocks1() { ret void }
14 define amdgpu_ps void @multiple_basic_blocks2() { ret void }
15 define amdgpu_ps void @multiple_basic_blocks3() { ret void }
16 define amdgpu_ps void @recursive_loop() { ret void }
17 define amdgpu_ps void @recursive_loop_vmem() { ret void }
18 define amdgpu_ps void @image_store() { ret void }
19 define amdgpu_ps void @scratch_store() { ret void }
20 define amdgpu_ps void @buffer_atomic() { ret void }
21 define amdgpu_ps void @flat_atomic() { ret void }
22 define amdgpu_ps void @global_atomic() { ret void }
23 define amdgpu_ps void @image_atomic() { ret void }
24 define amdgpu_ps void @global_store_optnone() noinline optnone { ret void }
25 define amdgpu_cs void @with_calls() { ret void }
26 define fastcc void @with_tail_calls() { ret void }
35 ; OPT-LABEL: name: tbuffer_store1
36 ; OPT: TBUFFER_STORE_FORMAT_XYZW_OFFSET_exact killed renamable $vgpr0_vgpr1_vgpr2_vgpr3, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, killed renamable $sgpr4, 42, 117, 0, 0, implicit $exec
38 ; OPT-NEXT: S_SENDMSG 3, implicit $exec, implicit $m0
39 ; OPT-NEXT: S_ENDPGM 0
41 ; NOOPT-LABEL: name: tbuffer_store1
42 ; NOOPT: TBUFFER_STORE_FORMAT_XYZW_OFFSET_exact killed renamable $vgpr0_vgpr1_vgpr2_vgpr3, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, killed renamable $sgpr4, 42, 117, 0, 0, implicit $exec
43 ; NOOPT-NEXT: S_ENDPGM 0
44 TBUFFER_STORE_FORMAT_XYZW_OFFSET_exact killed renamable $vgpr0_vgpr1_vgpr2_vgpr3, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, killed renamable $sgpr4, 42, 117, 0, 0, implicit $exec
54 ; OPT-LABEL: name: tbuffer_store2
55 ; OPT: TBUFFER_STORE_FORMAT_XYZW_OFFEN_exact killed renamable $vgpr0_vgpr1_vgpr2_vgpr3, killed renamable $vgpr4, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 115, 0, 0, implicit $exec :: (dereferenceable store (s128), align 1, addrspace 7)
57 ; OPT-NEXT: S_SENDMSG 3, implicit $exec, implicit $m0
58 ; OPT-NEXT: S_ENDPGM 0
60 ; NOOPT-LABEL: name: tbuffer_store2
61 ; NOOPT: TBUFFER_STORE_FORMAT_XYZW_OFFEN_exact killed renamable $vgpr0_vgpr1_vgpr2_vgpr3, killed renamable $vgpr4, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 115, 0, 0, implicit $exec :: (dereferenceable store (s128), align 1, addrspace 7)
62 ; NOOPT-NEXT: S_ENDPGM 0
63 TBUFFER_STORE_FORMAT_XYZW_OFFEN_exact killed renamable $vgpr0_vgpr1_vgpr2_vgpr3, killed renamable $vgpr4, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 115, 0, 0, implicit $exec :: (dereferenceable store (s128), align 1, addrspace 7)
73 ; CHECK-LABEL: name: flat_store
74 ; CHECK: FLAT_STORE_DWORDX4 $vgpr49_vgpr50, $vgpr26_vgpr27_vgpr28_vgpr29, 0, 0, implicit $exec, implicit $flat_scr
75 ; CHECK-NEXT: S_ENDPGM 0
76 FLAT_STORE_DWORDX4 $vgpr49_vgpr50, $vgpr26_vgpr27_vgpr28_vgpr29, 0, 0, implicit $exec, implicit $flat_scr
86 ; OPT-LABEL: name: global_store
87 ; OPT: GLOBAL_STORE_DWORD undef renamable $vgpr0_vgpr1, killed renamable $vgpr1, 0, 4, implicit $exec
88 ; OPT-NEXT: S_WAITCNT_VSCNT undef $sgpr_null, 0
90 ; OPT-NEXT: S_SENDMSG 3, implicit $exec, implicit $m0
91 ; OPT-NEXT: S_ENDPGM 0
93 ; NOOPT-LABEL: name: global_store
94 ; NOOPT: GLOBAL_STORE_DWORD undef renamable $vgpr0_vgpr1, killed renamable $vgpr1, 0, 4, implicit $exec
95 ; NOOPT-NEXT: S_WAITCNT_VSCNT undef $sgpr_null, 0
96 ; NOOPT-NEXT: S_ENDPGM 0
97 GLOBAL_STORE_DWORD undef renamable $vgpr0_vgpr1, killed renamable $vgpr1, 0, 4, implicit $exec
98 S_WAITCNT_VSCNT undef $sgpr_null, 0
103 name: buffer_store_format
105 isEntryFunction: true
108 ; OPT-LABEL: name: buffer_store_format
109 ; OPT: BUFFER_STORE_FORMAT_D16_X_OFFEN_exact killed renamable $vgpr0, killed renamable $vgpr1, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, killed renamable $sgpr4, 0, 0, 0, implicit $exec
111 ; OPT-NEXT: S_SENDMSG 3, implicit $exec, implicit $m0
112 ; OPT-NEXT: S_ENDPGM 0
114 ; NOOPT-LABEL: name: buffer_store_format
115 ; NOOPT: BUFFER_STORE_FORMAT_D16_X_OFFEN_exact killed renamable $vgpr0, killed renamable $vgpr1, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, killed renamable $sgpr4, 0, 0, 0, implicit $exec
116 ; NOOPT-NEXT: S_ENDPGM 0
117 BUFFER_STORE_FORMAT_D16_X_OFFEN_exact killed renamable $vgpr0, killed renamable $vgpr1, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, killed renamable $sgpr4, 0, 0, 0, implicit $exec
124 isEntryFunction: true
127 ; CHECK-LABEL: name: ds_write_b32
128 ; CHECK: renamable $vgpr0 = IMPLICIT_DEF
129 ; CHECK-NEXT: renamable $vgpr1 = IMPLICIT_DEF
130 ; CHECK-NEXT: DS_WRITE_B32_gfx9 killed renamable $vgpr0, killed renamable $vgpr1, 12, 0, implicit $exec
131 ; CHECK-NEXT: S_ENDPGM 0
132 renamable $vgpr0 = IMPLICIT_DEF
133 renamable $vgpr1 = IMPLICIT_DEF
134 DS_WRITE_B32_gfx9 killed renamable $vgpr0, killed renamable $vgpr1, 12, 0, implicit $exec
139 name: global_store_dword
141 isEntryFunction: true
144 liveins: $vgpr0, $sgpr0_sgpr1
146 ; OPT-LABEL: name: global_store_dword
147 ; OPT: liveins: $vgpr0, $sgpr0_sgpr1
149 ; OPT-NEXT: renamable $vgpr0 = V_MAD_I32_I24_e64 killed $vgpr1, killed $vgpr0, killed $sgpr2, 0, implicit $exec
150 ; OPT-NEXT: GLOBAL_STORE_DWORD_SADDR killed renamable $vgpr2, killed renamable $vgpr0, killed renamable $sgpr0_sgpr1, 0, 0, implicit $exec
152 ; OPT-NEXT: S_SENDMSG 3, implicit $exec, implicit $m0
153 ; OPT-NEXT: S_ENDPGM 0
155 ; NOOPT-LABEL: name: global_store_dword
156 ; NOOPT: liveins: $vgpr0, $sgpr0_sgpr1
158 ; NOOPT-NEXT: renamable $vgpr0 = V_MAD_I32_I24_e64 killed $vgpr1, killed $vgpr0, killed $sgpr2, 0, implicit $exec
159 ; NOOPT-NEXT: GLOBAL_STORE_DWORD_SADDR killed renamable $vgpr2, killed renamable $vgpr0, killed renamable $sgpr0_sgpr1, 0, 0, implicit $exec
160 ; NOOPT-NEXT: S_ENDPGM 0
161 renamable $vgpr0 = V_MAD_I32_I24_e64 killed $vgpr1, killed $vgpr0, killed $sgpr2, 0, implicit $exec
162 GLOBAL_STORE_DWORD_SADDR killed renamable $vgpr2, killed renamable $vgpr0, killed renamable $sgpr0_sgpr1, 0, 0, implicit $exec
167 name: multiple_basic_blocks1
169 isEntryFunction: true
171 ; CHECK-LABEL: name: multiple_basic_blocks1
173 ; CHECK-NEXT: successors: %bb.1(0x80000000)
175 ; CHECK-NEXT: renamable $vgpr0 = BUFFER_LOAD_FORMAT_X_IDXEN killed renamable $vgpr0, renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, implicit $exec
176 ; CHECK-NEXT: S_BRANCH %bb.1
179 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
181 ; CHECK-NEXT: S_WAITCNT 1015
182 ; CHECK-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr2, implicit $exec
183 ; CHECK-NEXT: S_CMP_LG_U32 killed renamable $sgpr3, renamable $sgpr4, implicit-def $scc
184 ; CHECK-NEXT: S_CBRANCH_SCC1 %bb.1, implicit killed $scc
185 ; CHECK-NEXT: S_BRANCH %bb.2
188 ; CHECK-NEXT: S_ENDPGM 0
192 renamable $vgpr0 = BUFFER_LOAD_FORMAT_X_IDXEN killed renamable $vgpr0, renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, implicit $exec
196 successors: %bb.1, %bb.2
198 $vgpr1 = V_ADD_U32_e32 renamable $vgpr0, renamable $vgpr2, implicit $exec
199 S_CMP_LG_U32 killed renamable $sgpr3, renamable $sgpr4, implicit-def $scc
200 S_CBRANCH_SCC1 %bb.1, implicit killed $scc
209 # One block has a VMEM store as the last instruction, we should release the VGPRS
212 name: multiple_basic_blocks2
214 isEntryFunction: true
216 ; OPT-LABEL: name: multiple_basic_blocks2
218 ; OPT-NEXT: successors: %bb.2(0x80000000)
220 ; OPT-NEXT: TBUFFER_STORE_FORMAT_X_OFFSET_exact killed renamable $vgpr0, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 125, 0, 0, implicit $exec
221 ; OPT-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr2, implicit $exec
222 ; OPT-NEXT: S_BRANCH %bb.2
225 ; OPT-NEXT: successors: %bb.2(0x80000000)
227 ; OPT-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr2, implicit $exec
228 ; OPT-NEXT: TBUFFER_STORE_FORMAT_X_OFFSET_exact killed renamable $vgpr0, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 125, 0, 0, implicit $exec
229 ; OPT-NEXT: S_BRANCH %bb.2
233 ; OPT-NEXT: S_SENDMSG 3, implicit $exec, implicit $m0
234 ; OPT-NEXT: S_ENDPGM 0
236 ; NOOPT-LABEL: name: multiple_basic_blocks2
238 ; NOOPT-NEXT: successors: %bb.2(0x80000000)
240 ; NOOPT-NEXT: TBUFFER_STORE_FORMAT_X_OFFSET_exact killed renamable $vgpr0, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 125, 0, 0, implicit $exec
241 ; NOOPT-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr2, implicit $exec
242 ; NOOPT-NEXT: S_BRANCH %bb.2
245 ; NOOPT-NEXT: successors: %bb.2(0x80000000)
247 ; NOOPT-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr2, implicit $exec
248 ; NOOPT-NEXT: TBUFFER_STORE_FORMAT_X_OFFSET_exact killed renamable $vgpr0, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 125, 0, 0, implicit $exec
249 ; NOOPT-NEXT: S_BRANCH %bb.2
252 ; NOOPT-NEXT: S_ENDPGM 0
256 TBUFFER_STORE_FORMAT_X_OFFSET_exact killed renamable $vgpr0, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 125, 0, 0, implicit $exec
257 $vgpr1 = V_ADD_U32_e32 renamable $vgpr0, renamable $vgpr2, implicit $exec
263 $vgpr1 = V_ADD_U32_e32 renamable $vgpr0, renamable $vgpr2, implicit $exec
264 TBUFFER_STORE_FORMAT_X_OFFSET_exact killed renamable $vgpr0, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 125, 0, 0, implicit $exec
272 # One parent block has a VMEM store, release VGPRs
274 name: multiple_basic_blocks3
276 isEntryFunction: true
278 ; OPT-LABEL: name: multiple_basic_blocks3
280 ; OPT-NEXT: successors: %bb.2(0x80000000)
282 ; OPT-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr2, implicit $exec
283 ; OPT-NEXT: TBUFFER_STORE_FORMAT_X_OFFSET_exact killed renamable $vgpr0, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 125, 0, 0, implicit $exec
284 ; OPT-NEXT: S_BRANCH %bb.2
287 ; OPT-NEXT: successors: %bb.2(0x80000000)
289 ; OPT-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr2, implicit $exec
290 ; OPT-NEXT: S_BRANCH %bb.2
293 ; OPT-NEXT: successors: %bb.4(0x80000000)
295 ; OPT-NEXT: S_BRANCH %bb.4
298 ; OPT-NEXT: successors: %bb.4(0x80000000)
300 ; OPT-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr2, implicit $exec
301 ; OPT-NEXT: S_BRANCH %bb.4
305 ; OPT-NEXT: S_SENDMSG 3, implicit $exec, implicit $m0
306 ; OPT-NEXT: S_ENDPGM 0
308 ; NOOPT-LABEL: name: multiple_basic_blocks3
310 ; NOOPT-NEXT: successors: %bb.2(0x80000000)
312 ; NOOPT-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr2, implicit $exec
313 ; NOOPT-NEXT: TBUFFER_STORE_FORMAT_X_OFFSET_exact killed renamable $vgpr0, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 125, 0, 0, implicit $exec
314 ; NOOPT-NEXT: S_BRANCH %bb.2
317 ; NOOPT-NEXT: successors: %bb.2(0x80000000)
319 ; NOOPT-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr2, implicit $exec
320 ; NOOPT-NEXT: S_BRANCH %bb.2
323 ; NOOPT-NEXT: successors: %bb.4(0x80000000)
325 ; NOOPT-NEXT: S_BRANCH %bb.4
328 ; NOOPT-NEXT: successors: %bb.4(0x80000000)
330 ; NOOPT-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr2, implicit $exec
331 ; NOOPT-NEXT: S_BRANCH %bb.4
334 ; NOOPT-NEXT: S_ENDPGM 0
338 $vgpr1 = V_ADD_U32_e32 renamable $vgpr0, renamable $vgpr2, implicit $exec
339 TBUFFER_STORE_FORMAT_X_OFFSET_exact killed renamable $vgpr0, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 125, 0, 0, implicit $exec
345 $vgpr1 = V_ADD_U32_e32 renamable $vgpr0, renamable $vgpr2, implicit $exec
356 $vgpr1 = V_ADD_U32_e32 renamable $vgpr0, renamable $vgpr2, implicit $exec
366 isEntryFunction: true
368 ; CHECK-LABEL: name: recursive_loop
370 ; CHECK-NEXT: successors: %bb.1(0x80000000)
372 ; CHECK-NEXT: renamable $vgpr0 = BUFFER_LOAD_FORMAT_X_IDXEN killed renamable $vgpr0, renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, implicit $exec
373 ; CHECK-NEXT: S_BRANCH %bb.1
376 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
378 ; CHECK-NEXT: S_CMP_LG_U32 killed renamable $sgpr3, renamable $sgpr4, implicit-def $scc
379 ; CHECK-NEXT: S_CBRANCH_SCC1 %bb.1, implicit killed $scc
380 ; CHECK-NEXT: S_BRANCH %bb.2
383 ; CHECK-NEXT: S_ENDPGM 0
387 renamable $vgpr0 = BUFFER_LOAD_FORMAT_X_IDXEN killed renamable $vgpr0, renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, implicit $exec
391 successors: %bb.1, %bb.2
393 S_CMP_LG_U32 killed renamable $sgpr3, renamable $sgpr4, implicit-def $scc
394 S_CBRANCH_SCC1 %bb.1, implicit killed $scc
402 name: recursive_loop_vmem
404 isEntryFunction: true
406 ; OPT-LABEL: name: recursive_loop_vmem
408 ; OPT-NEXT: successors: %bb.1(0x80000000)
410 ; OPT-NEXT: renamable $vgpr0 = BUFFER_LOAD_FORMAT_X_IDXEN killed renamable $vgpr0, renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, implicit $exec
411 ; OPT-NEXT: S_BRANCH %bb.1
414 ; OPT-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
416 ; OPT-NEXT: S_WAITCNT 1015
417 ; OPT-NEXT: TBUFFER_STORE_FORMAT_XYZW_OFFEN_exact killed renamable $vgpr0_vgpr1_vgpr2_vgpr3, killed renamable $vgpr4, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 115, 0, 0, implicit $exec
418 ; OPT-NEXT: S_CMP_LG_U32 killed renamable $sgpr3, renamable $sgpr4, implicit-def $scc
419 ; OPT-NEXT: S_CBRANCH_SCC1 %bb.1, implicit killed $scc
420 ; OPT-NEXT: S_BRANCH %bb.2
424 ; OPT-NEXT: S_SENDMSG 3, implicit $exec, implicit $m0
425 ; OPT-NEXT: S_ENDPGM 0
427 ; NOOPT-LABEL: name: recursive_loop_vmem
429 ; NOOPT-NEXT: successors: %bb.1(0x80000000)
431 ; NOOPT-NEXT: renamable $vgpr0 = BUFFER_LOAD_FORMAT_X_IDXEN killed renamable $vgpr0, renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, implicit $exec
432 ; NOOPT-NEXT: S_BRANCH %bb.1
435 ; NOOPT-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
437 ; NOOPT-NEXT: S_WAITCNT 1015
438 ; NOOPT-NEXT: TBUFFER_STORE_FORMAT_XYZW_OFFEN_exact killed renamable $vgpr0_vgpr1_vgpr2_vgpr3, killed renamable $vgpr4, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 115, 0, 0, implicit $exec
439 ; NOOPT-NEXT: S_CMP_LG_U32 killed renamable $sgpr3, renamable $sgpr4, implicit-def $scc
440 ; NOOPT-NEXT: S_CBRANCH_SCC1 %bb.1, implicit killed $scc
441 ; NOOPT-NEXT: S_BRANCH %bb.2
444 ; NOOPT-NEXT: S_ENDPGM 0
448 renamable $vgpr0 = BUFFER_LOAD_FORMAT_X_IDXEN killed renamable $vgpr0, renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, implicit $exec
452 successors: %bb.1, %bb.2
454 TBUFFER_STORE_FORMAT_XYZW_OFFEN_exact killed renamable $vgpr0_vgpr1_vgpr2_vgpr3, killed renamable $vgpr4, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 115, 0, 0, implicit $exec
455 S_CMP_LG_U32 killed renamable $sgpr3, renamable $sgpr4, implicit-def $scc
456 S_CBRANCH_SCC1 %bb.1, implicit killed $scc
466 isEntryFunction: true
469 ; OPT-LABEL: name: image_store
470 ; OPT: IMAGE_STORE_V2_V1_gfx11 killed renamable $vgpr0_vgpr1, killed renamable $vgpr2, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3_sgpr4_sgpr5_sgpr6_sgpr7, 12, 0, 1, 0, 0, -1, 0, 0, 0, implicit $exec :: (dereferenceable store (<2 x s32>), addrspace 7)
472 ; OPT-NEXT: S_SENDMSG 3, implicit $exec, implicit $m0
473 ; OPT-NEXT: S_ENDPGM 0
475 ; NOOPT-LABEL: name: image_store
476 ; NOOPT: IMAGE_STORE_V2_V1_gfx11 killed renamable $vgpr0_vgpr1, killed renamable $vgpr2, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3_sgpr4_sgpr5_sgpr6_sgpr7, 12, 0, 1, 0, 0, -1, 0, 0, 0, implicit $exec :: (dereferenceable store (<2 x s32>), addrspace 7)
477 ; NOOPT-NEXT: S_ENDPGM 0
478 IMAGE_STORE_V2_V1_gfx11 killed renamable $vgpr0_vgpr1, killed renamable $vgpr2, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3_sgpr4_sgpr5_sgpr6_sgpr7, 12, 0, 1, 0, 0, -1, 0, 0, 0, implicit $exec :: (dereferenceable store (<2 x s32>), addrspace 7)
485 isEntryFunction: true
488 ; CHECK-LABEL: name: scratch_store
489 ; CHECK: renamable $sgpr0 = S_AND_B32 killed renamable $sgpr0, -16, implicit-def dead $scc
490 ; CHECK-NEXT: SCRATCH_STORE_DWORD_SADDR killed renamable $vgpr0, killed renamable $sgpr0, 0, 0, implicit $exec, implicit $flat_scr
491 ; CHECK-NEXT: S_ENDPGM 0
492 renamable $sgpr0 = S_AND_B32 killed renamable $sgpr0, -16, implicit-def dead $scc
493 SCRATCH_STORE_DWORD_SADDR killed renamable $vgpr0, killed renamable $sgpr0, 0, 0, implicit $exec, implicit $flat_scr
500 isEntryFunction: true
503 ; OPT-LABEL: name: buffer_atomic
504 ; OPT: BUFFER_ATOMIC_ADD_F32_OFFEN killed renamable $vgpr0, killed renamable $vgpr2, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, implicit $exec :: (volatile dereferenceable load store (s64), align 1, addrspace 7)
506 ; OPT-NEXT: S_SENDMSG 3, implicit $exec, implicit $m0
507 ; OPT-NEXT: S_ENDPGM 0
509 ; NOOPT-LABEL: name: buffer_atomic
510 ; NOOPT: BUFFER_ATOMIC_ADD_F32_OFFEN killed renamable $vgpr0, killed renamable $vgpr2, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, implicit $exec :: (volatile dereferenceable load store (s64), align 1, addrspace 7)
511 ; NOOPT-NEXT: S_ENDPGM 0
512 BUFFER_ATOMIC_ADD_F32_OFFEN killed renamable $vgpr0, killed renamable $vgpr2, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, implicit $exec :: (volatile dereferenceable load store (s64), align 1, addrspace 7)
519 isEntryFunction: true
522 ; CHECK-LABEL: name: flat_atomic
523 ; CHECK: renamable $vgpr0_vgpr1 = FLAT_ATOMIC_DEC_X2_RTN killed renamable $vgpr0_vgpr1, killed renamable $vgpr2_vgpr3, 40, 1, implicit $exec, implicit $flat_scr
524 ; CHECK-NEXT: S_ENDPGM 0
525 renamable $vgpr0_vgpr1 = FLAT_ATOMIC_DEC_X2_RTN killed renamable $vgpr0_vgpr1, killed renamable $vgpr2_vgpr3, 40, 1, implicit $exec, implicit $flat_scr
533 isEntryFunction: true
536 ; CHECK-LABEL: name: global_atomic
537 ; CHECK: renamable $vgpr0_vgpr1 = GLOBAL_ATOMIC_INC_X2_SADDR_RTN killed renamable $vgpr0, killed renamable $vgpr1_vgpr2, killed renamable $sgpr0_sgpr1, 40, 1, implicit $exec
538 ; CHECK-NEXT: S_ENDPGM 0
539 renamable $vgpr0_vgpr1 = GLOBAL_ATOMIC_INC_X2_SADDR_RTN killed renamable $vgpr0, killed renamable $vgpr1_vgpr2, killed renamable $sgpr0_sgpr1, 40, 1, implicit $exec
546 isEntryFunction: true
549 ; CHECK-LABEL: name: image_atomic
550 ; CHECK: renamable $vgpr0_vgpr1_vgpr2_vgpr3 = IMAGE_ATOMIC_CMPSWAP_V2_V1_gfx11 killed renamable $vgpr0_vgpr1_vgpr2_vgpr3, killed renamable $vgpr4, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3_sgpr4_sgpr5_sgpr6_sgpr7, 15, 0, 1, 1, 0, 0, 0, 0, implicit $exec :: (volatile dereferenceable load store (s64), addrspace 7)
551 ; CHECK-NEXT: S_ENDPGM 0
552 renamable $vgpr0_vgpr1_vgpr2_vgpr3 = IMAGE_ATOMIC_CMPSWAP_V2_V1_gfx11 killed renamable $vgpr0_vgpr1_vgpr2_vgpr3, killed renamable $vgpr4, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3_sgpr4_sgpr5_sgpr6_sgpr7, 15, 0, 1, 1, 0, 0, 0, 0, implicit $exec :: (volatile dereferenceable load store (s64), addrspace 7)
557 name: global_store_optnone
559 isEntryFunction: true
562 ; CHECK-LABEL: name: global_store_optnone
563 ; CHECK: GLOBAL_STORE_DWORD undef renamable $vgpr0_vgpr1, killed renamable $vgpr1, 0, 4, implicit $exec
564 ; CHECK-NEXT: S_WAITCNT_VSCNT undef $sgpr_null, 0
565 ; CHECK-NEXT: S_ENDPGM 0
566 GLOBAL_STORE_DWORD undef renamable $vgpr0_vgpr1, killed renamable $vgpr1, 0, 4, implicit $exec
567 S_WAITCNT_VSCNT undef $sgpr_null, 0
577 ; Make sure we don't send DEALLOC_VGPRS after a call, since there might be
578 ; scratch stores still in progress.
579 ; CHECK-LABEL: name: with_calls
580 ; CHECK-NOT: S_SENDMSG 3
582 GLOBAL_STORE_DWORD undef renamable $vgpr0_vgpr1, killed renamable $vgpr1, 0, 4, implicit $exec
583 $sgpr30_sgpr31 = SI_CALL undef renamable $sgpr4_sgpr5, 0, csr_amdgpu
588 name: with_tail_calls
593 ; Make sure we don't send DEALLOC_VGPRS when there's a tail call, since the
594 ; only valid action after DEALLOC_VGPRS is to terminate the wave.
595 ; CHECK-LABEL: name: with_tail_calls
596 ; CHECK-NOT: S_SENDMSG 3
597 GLOBAL_STORE_DWORD undef renamable $vgpr0_vgpr1, killed renamable $vgpr1, 0, 4, implicit $exec
598 SI_TCRETURN undef renamable $sgpr4_sgpr5, @with_tail_calls, 0, csr_amdgpu