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 }
27 define amdgpu_cs void @waveslot_limited() { ret void }
36 ; OPT-LABEL: name: tbuffer_store1
37 ; 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
39 ; OPT-NEXT: S_SENDMSG 3, implicit $exec, implicit $m0
40 ; OPT-NEXT: S_ENDPGM 0, implicit $vgpr97
42 ; NOOPT-LABEL: name: tbuffer_store1
43 ; 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
44 ; NOOPT-NEXT: S_ENDPGM 0, implicit $vgpr97
45 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
46 S_ENDPGM 0, implicit $vgpr97
55 ; OPT-LABEL: name: tbuffer_store2
56 ; 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)
58 ; OPT-NEXT: S_SENDMSG 3, implicit $exec, implicit $m0
59 ; OPT-NEXT: S_ENDPGM 0, implicit $vgpr97
61 ; NOOPT-LABEL: name: tbuffer_store2
62 ; 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)
63 ; NOOPT-NEXT: S_ENDPGM 0, implicit $vgpr97
64 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)
65 S_ENDPGM 0, implicit $vgpr97
74 ; CHECK-LABEL: name: flat_store
75 ; CHECK: FLAT_STORE_DWORDX4 $vgpr49_vgpr50, $vgpr26_vgpr27_vgpr28_vgpr29, 0, 0, implicit $exec, implicit $flat_scr
76 ; CHECK-NEXT: S_ENDPGM 0, implicit $vgpr97
77 FLAT_STORE_DWORDX4 $vgpr49_vgpr50, $vgpr26_vgpr27_vgpr28_vgpr29, 0, 0, implicit $exec, implicit $flat_scr
78 S_ENDPGM 0, implicit $vgpr97
87 ; OPT-LABEL: name: global_store
88 ; OPT: GLOBAL_STORE_DWORD undef renamable $vgpr0_vgpr1, killed renamable $vgpr1, 0, 4, implicit $exec
89 ; OPT-NEXT: S_WAITCNT_VSCNT undef $sgpr_null, 0
91 ; OPT-NEXT: S_SENDMSG 3, implicit $exec, implicit $m0
92 ; OPT-NEXT: S_ENDPGM 0, implicit $vgpr97
94 ; NOOPT-LABEL: name: global_store
95 ; NOOPT: GLOBAL_STORE_DWORD undef renamable $vgpr0_vgpr1, killed renamable $vgpr1, 0, 4, implicit $exec
96 ; NOOPT-NEXT: S_WAITCNT_VSCNT undef $sgpr_null, 0
97 ; NOOPT-NEXT: S_ENDPGM 0, implicit $vgpr97
98 GLOBAL_STORE_DWORD undef renamable $vgpr0_vgpr1, killed renamable $vgpr1, 0, 4, implicit $exec
99 S_WAITCNT_VSCNT undef $sgpr_null, 0
100 S_ENDPGM 0, implicit $vgpr97
104 name: buffer_store_format
106 isEntryFunction: true
109 ; OPT-LABEL: name: buffer_store_format
110 ; 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
112 ; OPT-NEXT: S_SENDMSG 3, implicit $exec, implicit $m0
113 ; OPT-NEXT: S_ENDPGM 0, implicit $vgpr97
115 ; NOOPT-LABEL: name: buffer_store_format
116 ; 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
117 ; NOOPT-NEXT: S_ENDPGM 0, implicit $vgpr97
118 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
119 S_ENDPGM 0, implicit $vgpr97
125 isEntryFunction: true
128 ; CHECK-LABEL: name: ds_write_b32
129 ; CHECK: renamable $vgpr0 = IMPLICIT_DEF
130 ; CHECK-NEXT: renamable $vgpr1 = IMPLICIT_DEF
131 ; CHECK-NEXT: DS_WRITE_B32_gfx9 killed renamable $vgpr0, killed renamable $vgpr1, 12, 0, implicit $exec
132 ; CHECK-NEXT: S_ENDPGM 0, implicit $vgpr97
133 renamable $vgpr0 = IMPLICIT_DEF
134 renamable $vgpr1 = IMPLICIT_DEF
135 DS_WRITE_B32_gfx9 killed renamable $vgpr0, killed renamable $vgpr1, 12, 0, implicit $exec
136 S_ENDPGM 0, implicit $vgpr97
140 name: global_store_dword
142 isEntryFunction: true
145 liveins: $vgpr0, $sgpr0_sgpr1
147 ; OPT-LABEL: name: global_store_dword
148 ; OPT: liveins: $vgpr0, $sgpr0_sgpr1
150 ; OPT-NEXT: renamable $vgpr0 = V_MAD_I32_I24_e64 killed $vgpr1, killed $vgpr0, killed $sgpr2, 0, implicit $exec
151 ; OPT-NEXT: GLOBAL_STORE_DWORD_SADDR killed renamable $vgpr2, killed renamable $vgpr0, killed renamable $sgpr0_sgpr1, 0, 0, implicit $exec
153 ; OPT-NEXT: S_SENDMSG 3, implicit $exec, implicit $m0
154 ; OPT-NEXT: S_ENDPGM 0, implicit $vgpr97
156 ; NOOPT-LABEL: name: global_store_dword
157 ; NOOPT: liveins: $vgpr0, $sgpr0_sgpr1
159 ; NOOPT-NEXT: renamable $vgpr0 = V_MAD_I32_I24_e64 killed $vgpr1, killed $vgpr0, killed $sgpr2, 0, implicit $exec
160 ; NOOPT-NEXT: GLOBAL_STORE_DWORD_SADDR killed renamable $vgpr2, killed renamable $vgpr0, killed renamable $sgpr0_sgpr1, 0, 0, implicit $exec
161 ; NOOPT-NEXT: S_ENDPGM 0, implicit $vgpr97
162 renamable $vgpr0 = V_MAD_I32_I24_e64 killed $vgpr1, killed $vgpr0, killed $sgpr2, 0, implicit $exec
163 GLOBAL_STORE_DWORD_SADDR killed renamable $vgpr2, killed renamable $vgpr0, killed renamable $sgpr0_sgpr1, 0, 0, implicit $exec
164 S_ENDPGM 0, implicit $vgpr97
168 name: multiple_basic_blocks1
170 isEntryFunction: true
172 ; CHECK-LABEL: name: multiple_basic_blocks1
174 ; CHECK-NEXT: successors: %bb.1(0x80000000)
176 ; CHECK-NEXT: renamable $vgpr0 = BUFFER_LOAD_FORMAT_X_IDXEN killed renamable $vgpr0, renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, implicit $exec
177 ; CHECK-NEXT: S_BRANCH %bb.1
180 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
182 ; CHECK-NEXT: S_WAITCNT 1015
183 ; CHECK-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr2, implicit $exec
184 ; CHECK-NEXT: S_CMP_LG_U32 killed renamable $sgpr3, renamable $sgpr4, implicit-def $scc
185 ; CHECK-NEXT: S_CBRANCH_SCC1 %bb.1, implicit killed $scc
186 ; CHECK-NEXT: S_BRANCH %bb.2
189 ; CHECK-NEXT: S_ENDPGM 0, implicit $vgpr97
193 renamable $vgpr0 = BUFFER_LOAD_FORMAT_X_IDXEN killed renamable $vgpr0, renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, implicit $exec
197 successors: %bb.1, %bb.2
199 $vgpr1 = V_ADD_U32_e32 renamable $vgpr0, renamable $vgpr2, implicit $exec
200 S_CMP_LG_U32 killed renamable $sgpr3, renamable $sgpr4, implicit-def $scc
201 S_CBRANCH_SCC1 %bb.1, implicit killed $scc
205 S_ENDPGM 0, implicit $vgpr97
210 # One block has a VMEM store as the last instruction, we should release the VGPRS
213 name: multiple_basic_blocks2
215 isEntryFunction: true
217 ; OPT-LABEL: name: multiple_basic_blocks2
219 ; OPT-NEXT: successors: %bb.2(0x80000000)
221 ; OPT-NEXT: TBUFFER_STORE_FORMAT_X_OFFSET_exact killed renamable $vgpr0, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 125, 0, 0, implicit $exec
222 ; OPT-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr2, implicit $exec
223 ; OPT-NEXT: S_BRANCH %bb.2
226 ; OPT-NEXT: successors: %bb.2(0x80000000)
228 ; OPT-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr2, implicit $exec
229 ; OPT-NEXT: TBUFFER_STORE_FORMAT_X_OFFSET_exact killed renamable $vgpr0, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 125, 0, 0, implicit $exec
230 ; OPT-NEXT: S_BRANCH %bb.2
234 ; OPT-NEXT: S_SENDMSG 3, implicit $exec, implicit $m0
235 ; OPT-NEXT: S_ENDPGM 0, implicit $vgpr97
237 ; NOOPT-LABEL: name: multiple_basic_blocks2
239 ; NOOPT-NEXT: successors: %bb.2(0x80000000)
241 ; NOOPT-NEXT: TBUFFER_STORE_FORMAT_X_OFFSET_exact killed renamable $vgpr0, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 125, 0, 0, implicit $exec
242 ; NOOPT-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr2, implicit $exec
243 ; NOOPT-NEXT: S_BRANCH %bb.2
246 ; NOOPT-NEXT: successors: %bb.2(0x80000000)
248 ; NOOPT-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr2, implicit $exec
249 ; NOOPT-NEXT: TBUFFER_STORE_FORMAT_X_OFFSET_exact killed renamable $vgpr0, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 125, 0, 0, implicit $exec
250 ; NOOPT-NEXT: S_BRANCH %bb.2
253 ; NOOPT-NEXT: S_ENDPGM 0, implicit $vgpr97
257 TBUFFER_STORE_FORMAT_X_OFFSET_exact killed renamable $vgpr0, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 125, 0, 0, implicit $exec
258 $vgpr1 = V_ADD_U32_e32 renamable $vgpr0, renamable $vgpr2, implicit $exec
264 $vgpr1 = V_ADD_U32_e32 renamable $vgpr0, renamable $vgpr2, implicit $exec
265 TBUFFER_STORE_FORMAT_X_OFFSET_exact killed renamable $vgpr0, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 125, 0, 0, implicit $exec
269 S_ENDPGM 0, implicit $vgpr97
273 # One parent block has a VMEM store, release VGPRs
275 name: multiple_basic_blocks3
277 isEntryFunction: true
279 ; OPT-LABEL: name: multiple_basic_blocks3
281 ; OPT-NEXT: successors: %bb.2(0x80000000)
283 ; OPT-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr2, implicit $exec
284 ; OPT-NEXT: TBUFFER_STORE_FORMAT_X_OFFSET_exact killed renamable $vgpr0, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 125, 0, 0, implicit $exec
285 ; OPT-NEXT: S_BRANCH %bb.2
288 ; OPT-NEXT: successors: %bb.2(0x80000000)
290 ; OPT-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr2, implicit $exec
291 ; OPT-NEXT: S_BRANCH %bb.2
294 ; OPT-NEXT: successors: %bb.4(0x80000000)
296 ; OPT-NEXT: S_BRANCH %bb.4
299 ; OPT-NEXT: successors: %bb.4(0x80000000)
301 ; OPT-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr2, implicit $exec
302 ; OPT-NEXT: S_BRANCH %bb.4
306 ; OPT-NEXT: S_SENDMSG 3, implicit $exec, implicit $m0
307 ; OPT-NEXT: S_ENDPGM 0, implicit $vgpr97
309 ; NOOPT-LABEL: name: multiple_basic_blocks3
311 ; NOOPT-NEXT: successors: %bb.2(0x80000000)
313 ; NOOPT-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr2, implicit $exec
314 ; NOOPT-NEXT: TBUFFER_STORE_FORMAT_X_OFFSET_exact killed renamable $vgpr0, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 125, 0, 0, implicit $exec
315 ; NOOPT-NEXT: S_BRANCH %bb.2
318 ; NOOPT-NEXT: successors: %bb.2(0x80000000)
320 ; NOOPT-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr2, implicit $exec
321 ; NOOPT-NEXT: S_BRANCH %bb.2
324 ; NOOPT-NEXT: successors: %bb.4(0x80000000)
326 ; NOOPT-NEXT: S_BRANCH %bb.4
329 ; NOOPT-NEXT: successors: %bb.4(0x80000000)
331 ; NOOPT-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr2, implicit $exec
332 ; NOOPT-NEXT: S_BRANCH %bb.4
335 ; NOOPT-NEXT: S_ENDPGM 0, implicit $vgpr97
339 $vgpr1 = V_ADD_U32_e32 renamable $vgpr0, renamable $vgpr2, implicit $exec
340 TBUFFER_STORE_FORMAT_X_OFFSET_exact killed renamable $vgpr0, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 125, 0, 0, implicit $exec
346 $vgpr1 = V_ADD_U32_e32 renamable $vgpr0, renamable $vgpr2, implicit $exec
357 $vgpr1 = V_ADD_U32_e32 renamable $vgpr0, renamable $vgpr2, implicit $exec
361 S_ENDPGM 0, implicit $vgpr97
367 isEntryFunction: true
369 ; CHECK-LABEL: name: recursive_loop
371 ; CHECK-NEXT: successors: %bb.1(0x80000000)
373 ; CHECK-NEXT: renamable $vgpr0 = BUFFER_LOAD_FORMAT_X_IDXEN killed renamable $vgpr0, renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, implicit $exec
374 ; CHECK-NEXT: S_BRANCH %bb.1
377 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
379 ; CHECK-NEXT: S_CMP_LG_U32 killed renamable $sgpr3, renamable $sgpr4, implicit-def $scc
380 ; CHECK-NEXT: S_CBRANCH_SCC1 %bb.1, implicit killed $scc
381 ; CHECK-NEXT: S_BRANCH %bb.2
384 ; CHECK-NEXT: S_ENDPGM 0, implicit $vgpr97
388 renamable $vgpr0 = BUFFER_LOAD_FORMAT_X_IDXEN killed renamable $vgpr0, renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, implicit $exec
392 successors: %bb.1, %bb.2
394 S_CMP_LG_U32 killed renamable $sgpr3, renamable $sgpr4, implicit-def $scc
395 S_CBRANCH_SCC1 %bb.1, implicit killed $scc
399 S_ENDPGM 0, implicit $vgpr97
403 name: recursive_loop_vmem
405 isEntryFunction: true
407 ; OPT-LABEL: name: recursive_loop_vmem
409 ; OPT-NEXT: successors: %bb.1(0x80000000)
411 ; OPT-NEXT: renamable $vgpr0 = BUFFER_LOAD_FORMAT_X_IDXEN killed renamable $vgpr0, renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, implicit $exec
412 ; OPT-NEXT: S_BRANCH %bb.1
415 ; OPT-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
417 ; OPT-NEXT: S_WAITCNT 1015
418 ; 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
419 ; OPT-NEXT: S_CMP_LG_U32 killed renamable $sgpr3, renamable $sgpr4, implicit-def $scc
420 ; OPT-NEXT: S_CBRANCH_SCC1 %bb.1, implicit killed $scc
421 ; OPT-NEXT: S_BRANCH %bb.2
425 ; OPT-NEXT: S_SENDMSG 3, implicit $exec, implicit $m0
426 ; OPT-NEXT: S_ENDPGM 0, implicit $vgpr97
428 ; NOOPT-LABEL: name: recursive_loop_vmem
430 ; NOOPT-NEXT: successors: %bb.1(0x80000000)
432 ; NOOPT-NEXT: renamable $vgpr0 = BUFFER_LOAD_FORMAT_X_IDXEN killed renamable $vgpr0, renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, implicit $exec
433 ; NOOPT-NEXT: S_BRANCH %bb.1
436 ; NOOPT-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
438 ; NOOPT-NEXT: S_WAITCNT 1015
439 ; 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
440 ; NOOPT-NEXT: S_CMP_LG_U32 killed renamable $sgpr3, renamable $sgpr4, implicit-def $scc
441 ; NOOPT-NEXT: S_CBRANCH_SCC1 %bb.1, implicit killed $scc
442 ; NOOPT-NEXT: S_BRANCH %bb.2
445 ; NOOPT-NEXT: S_ENDPGM 0, implicit $vgpr97
449 renamable $vgpr0 = BUFFER_LOAD_FORMAT_X_IDXEN killed renamable $vgpr0, renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, implicit $exec
453 successors: %bb.1, %bb.2
455 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
456 S_CMP_LG_U32 killed renamable $sgpr3, renamable $sgpr4, implicit-def $scc
457 S_CBRANCH_SCC1 %bb.1, implicit killed $scc
461 S_ENDPGM 0, implicit $vgpr97
467 isEntryFunction: true
470 ; OPT-LABEL: name: image_store
471 ; 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)
473 ; OPT-NEXT: S_SENDMSG 3, implicit $exec, implicit $m0
474 ; OPT-NEXT: S_ENDPGM 0, implicit $vgpr97
476 ; NOOPT-LABEL: name: image_store
477 ; 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)
478 ; NOOPT-NEXT: S_ENDPGM 0, implicit $vgpr97
479 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)
480 S_ENDPGM 0, implicit $vgpr97
486 isEntryFunction: true
489 ; CHECK-LABEL: name: scratch_store
490 ; CHECK: renamable $sgpr0 = S_AND_B32 killed renamable $sgpr0, -16, implicit-def dead $scc
491 ; CHECK-NEXT: SCRATCH_STORE_DWORD_SADDR killed renamable $vgpr0, killed renamable $sgpr0, 0, 0, implicit $exec, implicit $flat_scr
492 ; CHECK-NEXT: S_ENDPGM 0, implicit $vgpr97
493 renamable $sgpr0 = S_AND_B32 killed renamable $sgpr0, -16, implicit-def dead $scc
494 SCRATCH_STORE_DWORD_SADDR killed renamable $vgpr0, killed renamable $sgpr0, 0, 0, implicit $exec, implicit $flat_scr
495 S_ENDPGM 0, implicit $vgpr97
501 isEntryFunction: true
504 ; OPT-LABEL: name: buffer_atomic
505 ; 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)
507 ; OPT-NEXT: S_SENDMSG 3, implicit $exec, implicit $m0
508 ; OPT-NEXT: S_ENDPGM 0, implicit $vgpr97
510 ; NOOPT-LABEL: name: buffer_atomic
511 ; 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)
512 ; NOOPT-NEXT: S_ENDPGM 0, implicit $vgpr97
513 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)
514 S_ENDPGM 0, implicit $vgpr97
520 isEntryFunction: true
523 ; CHECK-LABEL: name: flat_atomic
524 ; CHECK: renamable $vgpr0_vgpr1 = FLAT_ATOMIC_DEC_X2_RTN killed renamable $vgpr0_vgpr1, killed renamable $vgpr2_vgpr3, 40, 1, implicit $exec, implicit $flat_scr
525 ; CHECK-NEXT: S_ENDPGM 0, implicit $vgpr97
526 renamable $vgpr0_vgpr1 = FLAT_ATOMIC_DEC_X2_RTN killed renamable $vgpr0_vgpr1, killed renamable $vgpr2_vgpr3, 40, 1, implicit $exec, implicit $flat_scr
527 S_ENDPGM 0, implicit $vgpr97
534 isEntryFunction: true
537 ; CHECK-LABEL: name: global_atomic
538 ; 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
539 ; CHECK-NEXT: S_ENDPGM 0, implicit $vgpr97
540 renamable $vgpr0_vgpr1 = GLOBAL_ATOMIC_INC_X2_SADDR_RTN killed renamable $vgpr0, killed renamable $vgpr1_vgpr2, killed renamable $sgpr0_sgpr1, 40, 1, implicit $exec
541 S_ENDPGM 0, implicit $vgpr97
547 isEntryFunction: true
550 ; CHECK-LABEL: name: image_atomic
551 ; CHECK: renamable $vgpr0_vgpr1_vgpr2_vgpr3 = IMAGE_ATOMIC_CMPSWAP_V4_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)
552 ; CHECK-NEXT: S_ENDPGM 0, implicit $vgpr97
553 renamable $vgpr0_vgpr1_vgpr2_vgpr3 = IMAGE_ATOMIC_CMPSWAP_V4_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)
554 S_ENDPGM 0, implicit $vgpr97
558 name: global_store_optnone
560 isEntryFunction: true
563 ; CHECK-LABEL: name: global_store_optnone
564 ; CHECK: GLOBAL_STORE_DWORD undef renamable $vgpr0_vgpr1, killed renamable $vgpr1, 0, 4, implicit $exec
565 ; CHECK-NEXT: S_WAITCNT_VSCNT undef $sgpr_null, 0
566 ; CHECK-NEXT: S_ENDPGM 0, implicit $vgpr97
567 GLOBAL_STORE_DWORD undef renamable $vgpr0_vgpr1, killed renamable $vgpr1, 0, 4, implicit $exec
568 S_WAITCNT_VSCNT undef $sgpr_null, 0
569 S_ENDPGM 0, implicit $vgpr97
573 # Make sure we don't send DEALLOC_VGPRS after a call, since there might be
574 # scratch stores still in progress.
580 ; CHECK-LABEL: name: with_calls
582 ; CHECK-NEXT: GLOBAL_STORE_DWORD undef renamable $vgpr0_vgpr1, killed renamable $vgpr1, 0, 4, implicit $exec
583 ; CHECK-NEXT: $sgpr30_sgpr31 = SI_CALL undef renamable $sgpr4_sgpr5, 0, csr_amdgpu
584 ; CHECK-NEXT: S_ENDPGM 0, implicit $vgpr97
585 GLOBAL_STORE_DWORD undef renamable $vgpr0_vgpr1, killed renamable $vgpr1, 0, 4, implicit $exec
586 $sgpr30_sgpr31 = SI_CALL undef renamable $sgpr4_sgpr5, 0, csr_amdgpu
587 S_ENDPGM 0, implicit $vgpr97
591 # Make sure we don't send DEALLOC_VGPRS when there's a tail call, since the
592 # only valid action after DEALLOC_VGPRS is to terminate the wave.
593 name: with_tail_calls
598 ; CHECK-LABEL: name: with_tail_calls
600 ; CHECK-NEXT: GLOBAL_STORE_DWORD undef renamable $vgpr0_vgpr1, killed renamable $vgpr97, 0, 4, implicit $exec
601 ; CHECK-NEXT: SI_TCRETURN undef renamable $sgpr4_sgpr5, @with_tail_calls, 0, csr_amdgpu
602 GLOBAL_STORE_DWORD undef renamable $vgpr0_vgpr1, killed renamable $vgpr97, 0, 4, implicit $exec
603 SI_TCRETURN undef renamable $sgpr4_sgpr5, @with_tail_calls, 0, csr_amdgpu
607 # Do not deallocate VGPRs if kernel uses a small enough number of VGPRs
608 # making it likely waveslot limited and not VGPR limited. For gfx11 that
610 name: waveslot_limited
615 ; CHECK-LABEL: name: waveslot_limited
617 ; CHECK-NEXT: GLOBAL_STORE_DWORD undef renamable $vgpr0_vgpr1, killed renamable $vgpr96, 0, 4, implicit $exec
618 ; CHECK-NEXT: S_ENDPGM 0
619 GLOBAL_STORE_DWORD undef renamable $vgpr0_vgpr1, killed renamable $vgpr96, 0, 4, implicit $exec