1 # RUN: llc -mtriple=amdgcn -mcpu=gfx908 -verify-machineinstrs -run-pass post-RA-hazard-rec %s -o - | FileCheck -check-prefix=GCN %s
3 # GCN-LABEL: name: valu_write_vgpr_mfma_read
8 name: valu_write_vgpr_mfma_read
11 $vgpr0 = V_MOV_B32_e32 1, implicit $exec
12 $vgpr1 = V_MOV_B32_e32 1, implicit $exec
13 $agpr0_agpr1_agpr2_agpr3 = V_MFMA_F32_4X4X1F32_e64 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $mode, implicit $exec
17 # GCN-LABEL: name: valu_write_vgpr_accvgpr_write_read
20 # GCN-NEXT: V_ACCVGPR_WRITE_B32_e64
21 name: valu_write_vgpr_accvgpr_write_read
24 $vgpr0 = V_MOV_B32_e32 1, implicit $exec
25 $agpr0 = V_ACCVGPR_WRITE_B32_e64 killed $vgpr0, implicit $exec
28 # GCN-LABEL: name: asm_write_vgpr_accvgpr_write_read
31 # GCN-NEXT: V_ACCVGPR_WRITE_B32_e64
32 name: asm_write_vgpr_accvgpr_write_read
36 INLINEASM &"; def $0", 1 /* sideeffect attdialect */, 1966090 /* regdef:VGPR_32 */, def $vgpr0
37 $agpr0 = V_ACCVGPR_WRITE_B32_e64 killed $vgpr0, implicit $exec
41 # GCN-LABEL: name: asm_write_vgpr_accvgpr_write_read_partialnop
45 # GCN-NEXT: V_ACCVGPR_WRITE_B32_e64
46 name: asm_write_vgpr_accvgpr_write_read_partialnop
50 INLINEASM &"; def $0", 1 /* sideeffect attdialect */, 1966090 /* regdef:VGPR_32 */, def $vgpr0
52 $agpr0 = V_ACCVGPR_WRITE_B32_e64 killed $vgpr0, implicit $exec
56 # GCN-LABEL: name: asm_write_vgpr_accvgpr_write_read_otherreg
58 # GCN-NEXT: V_ACCVGPR_WRITE_B32_e64
59 name: asm_write_vgpr_accvgpr_write_read_otherreg
63 INLINEASM &"; def $0", 1 /* sideeffect attdialect */, 1966090 /* regdef:VGPR_32 */, def $vgpr1
64 $agpr0 = V_ACCVGPR_WRITE_B32_e64 killed $vgpr0, implicit $exec
68 # GCN-LABEL: name: bundle_write_vgpr_accvgpr_write_read
74 # GCN-NEXT: V_ACCVGPR_WRITE_B32_e64
75 name: bundle_write_vgpr_accvgpr_write_read
80 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
82 $agpr0 = V_ACCVGPR_WRITE_B32_e64 killed $vgpr0, implicit $exec
87 # GCN-LABEL: name: mfma_write_agpr_mfma_read_same_agpr
90 name: mfma_write_agpr_mfma_read_same_agpr
93 $agpr0_agpr1_agpr2_agpr3 = V_MFMA_F32_4X4X1F32_e64 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $mode, implicit $exec
94 $agpr0_agpr1_agpr2_agpr3 = V_MFMA_F32_4X4X1F32_e64 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $mode, implicit $exec
98 # GCN-LABEL: name: mfma_write_agpr_mfma_read_overlap
102 name: mfma_write_agpr_mfma_read_overlap
105 $agpr1_agpr2_agpr3_agpr4 = V_MFMA_F32_4X4X1F32_e64 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $mode, implicit $exec
106 $agpr0_agpr1_agpr2_agpr3 = V_MFMA_F32_4X4X1F32_e64 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $mode, implicit $exec
110 # GCN-LABEL: name: mfma_write_agpr_mfma_read_partial
114 name: mfma_write_agpr_mfma_read_partial
117 $agpr0_agpr1_agpr2_agpr3_agpr4_agpr5_agpr6_agpr7_agpr8_agpr9_agpr10_agpr11_agpr12_agpr13_agpr14_agpr15 = V_MFMA_F32_16X16X1F32_e64 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3_agpr4_agpr5_agpr6_agpr7_agpr8_agpr9_agpr10_agpr11_agpr12_agpr13_agpr14_agpr15, 0, 0, 0, implicit $mode, implicit $exec
118 $agpr0_agpr1_agpr2_agpr3 = V_MFMA_F32_4X4X1F32_e64 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $mode, implicit $exec
122 # GCN-LABEL: name: mfma_write_agpr_mfma_srca_read_overlap
126 name: mfma_write_agpr_mfma_srca_read_overlap
129 $agpr0_agpr1_agpr2_agpr3 = V_MFMA_F32_4X4X1F32_e64 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $mode, implicit $exec
130 $agpr0_agpr1_agpr2_agpr3 = V_MFMA_F32_4X4X1F32_e64 killed $agpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $mode, implicit $exec
134 # GCN-LABEL: name: mfma_write_agpr_mfma_srcb_read_overlap
138 name: mfma_write_agpr_mfma_srcb_read_overlap
141 $agpr0_agpr1_agpr2_agpr3 = V_MFMA_F32_4X4X1F32_e64 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $mode, implicit $exec
142 $agpr0_agpr1_agpr2_agpr3 = V_MFMA_F32_4X4X1F32_e64 killed $vgpr1, killed $agpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $mode, implicit $exec
146 # GCN-LABEL: name: mfma_4x4_write_agpr_accvgpr_read
147 # GCN: V_MFMA_F32_4X4X1F32
149 # GCN-NEXT: V_ACCVGPR_READ_B32_e64
150 name: mfma_4x4_write_agpr_accvgpr_read
153 $agpr0_agpr1_agpr2_agpr3 = V_MFMA_F32_4X4X1F32_e64 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $mode, implicit $exec
154 $vgpr0 = V_ACCVGPR_READ_B32_e64 killed $agpr0, implicit $exec
158 # GCN-LABEL: name: mfma_16x16_write_agpr_accvgpr_read
159 # GCN: V_MFMA_F32_16X16X1F32
162 # GCN-NEXT: V_ACCVGPR_READ_B32_e64
163 name: mfma_16x16_write_agpr_accvgpr_read
166 $agpr0_agpr1_agpr2_agpr3_agpr4_agpr5_agpr6_agpr7_agpr8_agpr9_agpr10_agpr11_agpr12_agpr13_agpr14_agpr15 = V_MFMA_F32_16X16X1F32_e64 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3_agpr4_agpr5_agpr6_agpr7_agpr8_agpr9_agpr10_agpr11_agpr12_agpr13_agpr14_agpr15, 0, 0, 0, implicit $mode, implicit $exec
167 $vgpr0 = V_ACCVGPR_READ_B32_e64 killed $agpr0, implicit $exec
171 # GCN-LABEL: name: mfma_32x32_write_agpr_accvgpr_read
172 # GCN: V_MFMA_F32_32X32X2F32
176 # GCN-NEXT: V_ACCVGPR_READ_B32_e64
177 name: mfma_32x32_write_agpr_accvgpr_read
180 $agpr0_agpr1_agpr2_agpr3_agpr4_agpr5_agpr6_agpr7_agpr8_agpr9_agpr10_agpr11_agpr12_agpr13_agpr14_agpr15 = V_MFMA_F32_32X32X2F32_e64 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3_agpr4_agpr5_agpr6_agpr7_agpr8_agpr9_agpr10_agpr11_agpr12_agpr13_agpr14_agpr15, 0, 0, 0, implicit $mode, implicit $exec
181 $vgpr0 = V_ACCVGPR_READ_B32_e64 killed $agpr0, implicit $exec
185 # GCN-LABEL: name: mfma_4x4_write_agpr_accvgpr_write
186 # GCN: V_MFMA_F32_4X4X1F32
188 # GCN-NEXT: V_ACCVGPR_WRITE_B32_e64
189 name: mfma_4x4_write_agpr_accvgpr_write
192 $agpr0_agpr1_agpr2_agpr3 = V_MFMA_F32_4X4X1F32_e64 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $mode, implicit $exec
193 $agpr0 = V_ACCVGPR_WRITE_B32_e64 killed $vgpr0, implicit $exec
197 # GCN-LABEL: name: mfma_16x16_write_agpr_accvgpr_write
198 # GCN: V_MFMA_F32_16X16X1F32
200 # GCN-NEXT: V_ACCVGPR_WRITE_B32_e64
201 name: mfma_16x16_write_agpr_accvgpr_write
204 $agpr0_agpr1_agpr2_agpr3_agpr4_agpr5_agpr6_agpr7_agpr8_agpr9_agpr10_agpr11_agpr12_agpr13_agpr14_agpr15 = V_MFMA_F32_16X16X1F32_e64 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3_agpr4_agpr5_agpr6_agpr7_agpr8_agpr9_agpr10_agpr11_agpr12_agpr13_agpr14_agpr15, 0, 0, 0, implicit $mode, implicit $exec
205 $agpr0 = V_ACCVGPR_WRITE_B32_e64 killed $vgpr0, implicit $exec
209 # GCN-LABEL: name: mfma_32x32_write_agpr_accvgpr_write
210 # GCN: V_MFMA_F32_32X32X2F32
213 # GCN-NEXT: V_ACCVGPR_WRITE_B32_e64
214 name: mfma_32x32_write_agpr_accvgpr_write
217 $agpr0_agpr1_agpr2_agpr3_agpr4_agpr5_agpr6_agpr7_agpr8_agpr9_agpr10_agpr11_agpr12_agpr13_agpr14_agpr15 = V_MFMA_F32_32X32X2F32_e64 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3_agpr4_agpr5_agpr6_agpr7_agpr8_agpr9_agpr10_agpr11_agpr12_agpr13_agpr14_agpr15, 0, 0, 0, implicit $mode, implicit $exec
218 $agpr0 = V_ACCVGPR_WRITE_B32_e64 killed $vgpr0, implicit $exec
222 # GCN-LABEL: name: mfma_4x4_read_srcc_accvgpr_write
223 # GCN: V_MFMA_F32_4X4X1F32
224 # GCN-NEXT: V_ACCVGPR_WRITE_B32_e64
225 name: mfma_4x4_read_srcc_accvgpr_write
228 $agpr4_agpr5_agpr6_agpr7 = V_MFMA_F32_4X4X1F32_e64 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $mode, implicit $exec
229 $agpr0 = V_ACCVGPR_WRITE_B32_e64 killed $vgpr2, implicit $exec
233 # GCN-LABEL: name: mfma_16x16_read_srcc_accvgpr_write
234 # GCN: V_MFMA_F32_16X16X1F32
236 # GCN-NEXT: V_ACCVGPR_WRITE_B32_e64
237 name: mfma_16x16_read_srcc_accvgpr_write
240 $agpr16_agpr17_agpr18_agpr19_agpr20_agpr21_agpr22_agpr23_agpr24_agpr25_agpr26_agpr27_agpr28_agpr29_agpr30_agpr31 = V_MFMA_F32_16X16X1F32_e64 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3_agpr4_agpr5_agpr6_agpr7_agpr8_agpr9_agpr10_agpr11_agpr12_agpr13_agpr14_agpr15, 0, 0, 0, implicit $mode, implicit $exec
241 $agpr0 = V_ACCVGPR_WRITE_B32_e64 killed $vgpr2, implicit $exec
245 # GCN-LABEL: name: mfma_32x32_read_srcc_accvgpr_write
246 # GCN: V_MFMA_F32_32X32X2F32
249 # GCN-NEXT: V_ACCVGPR_WRITE_B32_e64
250 name: mfma_32x32_read_srcc_accvgpr_write
253 $agpr16_agpr17_agpr18_agpr19_agpr20_agpr21_agpr22_agpr23_agpr24_agpr25_agpr26_agpr27_agpr28_agpr29_agpr30_agpr31 = V_MFMA_F32_32X32X2F32_e64 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3_agpr4_agpr5_agpr6_agpr7_agpr8_agpr9_agpr10_agpr11_agpr12_agpr13_agpr14_agpr15, 0, 0, 0, implicit $mode, implicit $exec
254 $agpr0 = V_ACCVGPR_WRITE_B32_e64 killed $vgpr2, implicit $exec
258 # GCN-LABEL: name: accvgpr_read_write_vgpr_valu_read
259 # GCN: V_ACCVGPR_READ_B32_e64
260 # GCN-NEXT: V_ADD_F32
261 name: accvgpr_read_write_vgpr_valu_read
264 $vgpr0 = V_ACCVGPR_READ_B32_e64 killed $agpr4, implicit $exec
265 $vgpr1 = V_ADD_F32_e32 0, killed $vgpr0, implicit $mode, implicit $exec
269 # GCN-LABEL: name: accvgpr_read_write_vgpr_mfma_read
270 # GCN: V_ACCVGPR_READ_B32_e64
273 name: accvgpr_read_write_vgpr_mfma_read
276 $vgpr0 = V_ACCVGPR_READ_B32_e64 killed $agpr4, implicit $exec
277 $agpr0_agpr1_agpr2_agpr3 = V_MFMA_F32_4X4X1F32_e64 killed $vgpr0, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $mode, implicit $exec
281 # GCN-LABEL: name: accvgpr_read_write_vgpr_accvgpr_write_read
282 # GCN: V_ACCVGPR_READ_B32_e64
284 # GCN-NEXT: V_ACCVGPR_WRITE_B32_e64
285 name: accvgpr_read_write_vgpr_accvgpr_write_read
288 $vgpr0 = V_ACCVGPR_READ_B32_e64 killed $agpr1, implicit $exec
289 $agpr0 = V_ACCVGPR_WRITE_B32_e64 killed $vgpr0, implicit $exec
293 # GCN-LABEL: name: accvgpr_write_agpr_mfma_read_srcc
294 # GCN: V_ACCVGPR_WRITE_B32_e64
297 name: accvgpr_write_agpr_mfma_read_srcc
300 $agpr0 = V_ACCVGPR_WRITE_B32_e64 killed $vgpr0, implicit $exec
301 $agpr4_agpr5_agpr6_agpr7 = V_MFMA_F32_4X4X1F32_e64 killed $vgpr1, killed $vgpr2, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $mode, implicit $exec
305 # GCN-LABEL: name: accvgpr_write_agpr_mfma_read_srca
306 # GCN: V_ACCVGPR_WRITE_B32_e64
309 name: accvgpr_write_agpr_mfma_read_srca
312 $agpr8 = V_ACCVGPR_WRITE_B32_e64 killed $vgpr0, implicit $exec
313 $agpr4_agpr5_agpr6_agpr7 = V_MFMA_F32_4X4X1F32_e64 killed $agpr8, killed $vgpr1, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $mode, implicit $exec
317 # GCN-LABEL: name: accvgpr_write_agpr_mfma_read_srcb
318 # GCN: V_ACCVGPR_WRITE_B32_e64
321 name: accvgpr_write_agpr_mfma_read_srcb
324 $agpr8 = V_ACCVGPR_WRITE_B32_e64 killed $vgpr0, implicit $exec
325 $agpr4_agpr5_agpr6_agpr7 = V_MFMA_F32_4X4X1F32_e64 killed $vgpr1, killed $agpr8, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $mode, implicit $exec
329 # GCN-LABEL: name: accvgpr_write_agpr_accvgpr_read
330 # GCN: V_ACCVGPR_WRITE_B32_e64
332 # GCN-NEXT: V_ACCVGPR_READ_B32_e64
333 name: accvgpr_write_agpr_accvgpr_read
336 $agpr0 = V_ACCVGPR_WRITE_B32_e64 killed $vgpr0, implicit $exec
337 $vgpr1 = V_ACCVGPR_READ_B32_e64 killed $agpr0, implicit $exec
341 # GCN-LABEL: name: vcmpx_write_exec_mfma
342 # GCN: V_CMPX_EQ_I32_e32
345 name: vcmpx_write_exec_mfma
348 implicit $exec, implicit $vcc = V_CMPX_EQ_I32_e32 $vgpr0, $vgpr1, implicit $exec
349 $agpr4_agpr5_agpr6_agpr7 = V_MFMA_F32_4X4X1F32_e64 killed $agpr8, killed $vgpr1, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $mode, implicit $exec
353 # GCN-LABEL: name: vcmpx_write_exec_accvgpr_write
354 # GCN: V_CMPX_EQ_I32_e32
356 # GCN-NEXT: V_ACCVGPR_WRITE_B32_e64
357 name: vcmpx_write_exec_accvgpr_write
360 implicit $exec, implicit $vcc = V_CMPX_EQ_I32_e32 $vgpr0, $vgpr1, implicit $exec
361 $agpr0 = V_ACCVGPR_WRITE_B32_e64 killed $vgpr2, implicit $exec
365 # GCN-LABEL: name: accvgpr_read_write_vgpr_load
366 # GCN: V_ACCVGPR_READ_B32_e64
368 # GCN-NEXT: FLAT_LOAD_DWORD
369 name: accvgpr_read_write_vgpr_load
372 $vgpr0 = V_ACCVGPR_READ_B32_e64 killed $agpr0, implicit $exec
373 $vgpr3 = FLAT_LOAD_DWORD $vgpr0_vgpr1, 0, 0, implicit $exec, implicit $flat_scr
377 # GCN-LABEL: name: accvgpr_read_write_vgpr_ds_permute
378 # GCN: V_ACCVGPR_READ_B32_e64
380 # GCN-NEXT: DS_PERMUTE_B32
381 name: accvgpr_read_write_vgpr_ds_permute
384 $vgpr0 = V_ACCVGPR_READ_B32_e64 killed $agpr0, implicit $exec
385 $vgpr1 = DS_PERMUTE_B32 $vgpr0, $vgpr1, 0, implicit $exec
389 # GCN-LABEL: name: accvgpr_read_write_vgpr_flat_load
390 # GCN: V_ACCVGPR_READ_B32_e64
392 # GCN-NEXT: FLAT_LOAD_DWORD
393 name: accvgpr_read_write_vgpr_flat_load
396 $vgpr0 = V_ACCVGPR_READ_B32_e64 killed $agpr0, implicit $exec
397 $vgpr4 = FLAT_LOAD_DWORD $vgpr0_vgpr1, 0, 0, implicit $exec, implicit $flat_scr
401 # GCN-LABEL: name: accvgpr_read_write_vgpr_buffer_store
402 # GCN: V_ACCVGPR_READ_B32_e64
404 # GCN-NEXT: BUFFER_STORE_DWORD_OFFSET
405 name: accvgpr_read_write_vgpr_buffer_store
408 $vgpr0 = V_ACCVGPR_READ_B32_e64 killed $agpr0, implicit $exec
409 BUFFER_STORE_DWORD_OFFSET $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, implicit $exec
413 # GCN-LABEL: name: accvgpr_read_write_vgpr_store
414 # GCN: V_ACCVGPR_READ_B32_e64
416 # GCN-NEXT: DS_WRITE_B32
417 name: accvgpr_read_write_vgpr_store
420 $vgpr0 = V_ACCVGPR_READ_B32_e64 killed $agpr0, implicit $exec
421 DS_WRITE_B32 $vgpr0, $vgpr1, 0, 0, implicit $m0, implicit $exec
425 # GCN-LABEL: name: valu_write_vgpr_accvgpr_read_load_no_dependency
427 # GCN-NEXT: V_ACCVGPR_READ_B32_e64
428 # GCN-NEXT: FLAT_LOAD_DWORD
429 name: valu_write_vgpr_accvgpr_read_load_no_dependency
432 $vgpr0 = V_MOV_B32_e32 1, implicit $exec
433 $vgpr1 = V_ACCVGPR_READ_B32_e64 killed $agpr0, implicit $exec
434 $vgpr4 = FLAT_LOAD_DWORD $vgpr2_vgpr3, 0, 0, implicit $exec, implicit $flat_scr
438 # GCN-LABEL: name: valu_write_vgpr_accvgpr_read_load_1_and_3_depend
440 # GCN-NEXT: V_ACCVGPR_READ_B32_e64
442 # GCN-NEXT: FLAT_LOAD_DWORD
443 name: valu_write_vgpr_accvgpr_read_load_1_and_3_depend
446 $vgpr0 = V_MOV_B32_e32 1, implicit $exec
447 $vgpr2 = V_ACCVGPR_READ_B32_e64 killed $agpr0, implicit $exec
448 $vgpr4 = FLAT_LOAD_DWORD $vgpr0_vgpr1, 0, 0, implicit $exec, implicit $flat_scr
452 # GCN-LABEL: name: valu_write_vgpr_accvgpr_write_load_1_and_3_depend
454 # GCN-NEXT: V_ACCVGPR_WRITE_B32_e64
456 # GCN-NEXT: FLAT_LOAD_DWORD
457 name: valu_write_vgpr_accvgpr_write_load_1_and_3_depend
460 $vgpr0 = V_MOV_B32_e32 1, implicit $exec
461 $agpr0 = V_ACCVGPR_WRITE_B32_e64 killed $vgpr2, implicit $exec
462 $vgpr4 = FLAT_LOAD_DWORD $vgpr0_vgpr1, 0, 0, implicit $exec, implicit $flat_scr
466 # GCN-LABEL: name: valu_write_vgpr_accvgpr_read_load_2_and_3_depend
468 # GCN-NEXT: V_ACCVGPR_READ_B32_e64
470 # GCN-NEXT: FLAT_LOAD_DWORD
471 name: valu_write_vgpr_accvgpr_read_load_2_and_3_depend
474 $vgpr0 = V_MOV_B32_e32 1, implicit $exec
475 $vgpr2 = V_ACCVGPR_READ_B32_e64 killed $agpr0, implicit $exec
476 $vgpr4 = FLAT_LOAD_DWORD $vgpr2_vgpr3, 0, 0, implicit $exec, implicit $flat_scr