1 # RUN: llc -march=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
9 name: valu_write_vgpr_mfma_read
12 $vgpr0 = V_MOV_B32_e32 1, implicit $exec
13 $vgpr1 = V_MOV_B32_e32 1, implicit $exec
14 $agpr0_agpr1_agpr2_agpr3 = V_MFMA_F32_4X4X1F32 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $exec
18 # GCN-LABEL: name: valu_write_vgpr_accvgpr_write_read
22 # GCN-NEXT: V_ACCVGPR_WRITE_B32
23 name: valu_write_vgpr_accvgpr_write_read
26 $vgpr0 = V_MOV_B32_e32 1, implicit $exec
27 $agpr0 = V_ACCVGPR_WRITE_B32 killed $vgpr0, implicit $exec
31 # GCN-LABEL: name: mfma_write_agpr_mfma_read_same_agpr
34 name: mfma_write_agpr_mfma_read_same_agpr
37 $agpr0_agpr1_agpr2_agpr3 = V_MFMA_F32_4X4X1F32 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $exec
38 $agpr0_agpr1_agpr2_agpr3 = V_MFMA_F32_4X4X1F32 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $exec
42 # GCN-LABEL: name: mfma_write_agpr_mfma_read_overlap
47 name: mfma_write_agpr_mfma_read_overlap
50 $agpr1_agpr2_agpr3_agpr4 = V_MFMA_F32_4X4X1F32 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $exec
51 $agpr0_agpr1_agpr2_agpr3 = V_MFMA_F32_4X4X1F32 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $exec
55 # GCN-LABEL: name: mfma_write_agpr_mfma_read_partial
60 name: mfma_write_agpr_mfma_read_partial
63 $agpr0_agpr1_agpr2_agpr3_agpr4_agpr5_agpr6_agpr7_agpr8_agpr9_agpr10_agpr11_agpr12_agpr13_agpr14_agpr15 = V_MFMA_F32_16X16X1F32 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 $exec
64 $agpr0_agpr1_agpr2_agpr3 = V_MFMA_F32_4X4X1F32 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $exec
68 # GCN-LABEL: name: mfma_write_agpr_mfma_srca_read_overlap
75 name: mfma_write_agpr_mfma_srca_read_overlap
78 $agpr0_agpr1_agpr2_agpr3 = V_MFMA_F32_4X4X1F32 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $exec
79 $agpr0_agpr1_agpr2_agpr3 = V_MFMA_F32_4X4X1F32 killed $agpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $exec
83 # GCN-LABEL: name: mfma_write_agpr_mfma_srcb_read_overlap
90 name: mfma_write_agpr_mfma_srcb_read_overlap
93 $agpr0_agpr1_agpr2_agpr3 = V_MFMA_F32_4X4X1F32 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $exec
94 $agpr0_agpr1_agpr2_agpr3 = V_MFMA_F32_4X4X1F32 killed $vgpr1, killed $agpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $exec
98 # GCN-LABEL: name: mfma_4x4_write_agpr_accvgpr_read
99 # GCN: V_MFMA_F32_4X4X1F32
104 # GCN-NEXT: V_ACCVGPR_READ_B32
105 name: mfma_4x4_write_agpr_accvgpr_read
108 $agpr0_agpr1_agpr2_agpr3 = V_MFMA_F32_4X4X1F32 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $exec
109 $vgpr0 = V_ACCVGPR_READ_B32 killed $agpr0, implicit $exec
113 # GCN-LABEL: name: mfma_16x16_write_agpr_accvgpr_read
114 # GCN: V_MFMA_F32_16X16X1F32
125 # GCN-NEXT: V_ACCVGPR_READ_B32
126 name: mfma_16x16_write_agpr_accvgpr_read
129 $agpr0_agpr1_agpr2_agpr3_agpr4_agpr5_agpr6_agpr7_agpr8_agpr9_agpr10_agpr11_agpr12_agpr13_agpr14_agpr15 = V_MFMA_F32_16X16X1F32 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 $exec
130 $vgpr0 = V_ACCVGPR_READ_B32 killed $agpr0, implicit $exec
134 # GCN-LABEL: name: mfma_32x32_write_agpr_accvgpr_read
135 # GCN: V_MFMA_F32_32X32X2F32
154 # GCN-NEXT: V_ACCVGPR_READ_B32
155 name: mfma_32x32_write_agpr_accvgpr_read
158 $agpr0_agpr1_agpr2_agpr3_agpr4_agpr5_agpr6_agpr7_agpr8_agpr9_agpr10_agpr11_agpr12_agpr13_agpr14_agpr15 = V_MFMA_F32_32X32X2F32 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 $exec
159 $vgpr0 = V_ACCVGPR_READ_B32 killed $agpr0, implicit $exec
163 # GCN-LABEL: name: mfma_4x4_write_agpr_accvgpr_write
164 # GCN: V_MFMA_F32_4X4X1F32
166 # GCN-NEXT: V_ACCVGPR_WRITE_B32
167 name: mfma_4x4_write_agpr_accvgpr_write
170 $agpr0_agpr1_agpr2_agpr3 = V_MFMA_F32_4X4X1F32 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $exec
171 $agpr0 = V_ACCVGPR_WRITE_B32 killed $vgpr0, implicit $exec
175 # GCN-LABEL: name: mfma_16x16_write_agpr_accvgpr_write
176 # GCN: V_MFMA_F32_16X16X1F32
184 # GCN-NEXT: V_ACCVGPR_WRITE_B32
185 name: mfma_16x16_write_agpr_accvgpr_write
188 $agpr0_agpr1_agpr2_agpr3_agpr4_agpr5_agpr6_agpr7_agpr8_agpr9_agpr10_agpr11_agpr12_agpr13_agpr14_agpr15 = V_MFMA_F32_16X16X1F32 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 $exec
189 $agpr0 = V_ACCVGPR_WRITE_B32 killed $vgpr0, implicit $exec
193 # GCN-LABEL: name: mfma_32x32_write_agpr_accvgpr_write
194 # GCN: V_MFMA_F32_32X32X2F32
210 # GCN-NEXT: V_ACCVGPR_WRITE_B32
211 name: mfma_32x32_write_agpr_accvgpr_write
214 $agpr0_agpr1_agpr2_agpr3_agpr4_agpr5_agpr6_agpr7_agpr8_agpr9_agpr10_agpr11_agpr12_agpr13_agpr14_agpr15 = V_MFMA_F32_32X32X2F32 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 $exec
215 $agpr0 = V_ACCVGPR_WRITE_B32 killed $vgpr0, implicit $exec
219 # GCN-LABEL: name: mfma_4x4_read_srcc_accvgpr_write
220 # GCN: V_MFMA_F32_4X4X1F32
221 # GCN-NEXT: V_ACCVGPR_WRITE_B32
222 name: mfma_4x4_read_srcc_accvgpr_write
225 $agpr4_agpr5_agpr6_agpr7 = V_MFMA_F32_4X4X1F32 killed $vgpr1, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $exec
226 $agpr0 = V_ACCVGPR_WRITE_B32 killed $vgpr2, implicit $exec
230 # GCN-LABEL: name: mfma_16x16_read_srcc_accvgpr_write
231 # GCN: V_MFMA_F32_16X16X1F32
237 # GCN-NEXT: V_ACCVGPR_WRITE_B32
238 name: mfma_16x16_read_srcc_accvgpr_write
241 $agpr16_agpr17_agpr18_agpr19_agpr20_agpr21_agpr22_agpr23_agpr24_agpr25_agpr26_agpr27_agpr28_agpr29_agpr30_agpr31 = V_MFMA_F32_16X16X1F32 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 $exec
242 $agpr0 = V_ACCVGPR_WRITE_B32 killed $vgpr2, implicit $exec
246 # GCN-LABEL: name: mfma_32x32_read_srcc_accvgpr_write
247 # GCN: V_MFMA_F32_32X32X2F32
261 # GCN-NEXT: V_ACCVGPR_WRITE_B32
262 name: mfma_32x32_read_srcc_accvgpr_write
265 $agpr16_agpr17_agpr18_agpr19_agpr20_agpr21_agpr22_agpr23_agpr24_agpr25_agpr26_agpr27_agpr28_agpr29_agpr30_agpr31 = V_MFMA_F32_32X32X2F32 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 $exec
266 $agpr0 = V_ACCVGPR_WRITE_B32 killed $vgpr2, implicit $exec
270 # GCN-LABEL: name: accvgpr_read_write_vgpr_valu_read
271 # GCN: V_ACCVGPR_READ_B32
272 # GCN-NEXT: V_ADD_F32
273 name: accvgpr_read_write_vgpr_valu_read
276 $vgpr0 = V_ACCVGPR_READ_B32 killed $agpr4, implicit $exec
277 $vgpr1 = V_ADD_F32_e32 0, killed $vgpr0, implicit $exec
281 # GCN-LABEL: name: accvgpr_read_write_vgpr_mfma_read
282 # GCN: V_ACCVGPR_READ_B32
286 name: accvgpr_read_write_vgpr_mfma_read
289 $vgpr0 = V_ACCVGPR_READ_B32 killed $agpr4, implicit $exec
290 $agpr0_agpr1_agpr2_agpr3 = V_MFMA_F32_4X4X1F32 killed $vgpr0, killed $vgpr0, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $exec
294 # GCN-LABEL: name: accvgpr_read_write_vgpr_accvgpr_write_read
295 # GCN: V_ACCVGPR_READ_B32
298 # GCN-NEXT: V_ACCVGPR_WRITE_B32
299 name: accvgpr_read_write_vgpr_accvgpr_write_read
302 $vgpr0 = V_ACCVGPR_READ_B32 killed $agpr1, implicit $exec
303 $agpr0 = V_ACCVGPR_WRITE_B32 killed $vgpr0, implicit $exec
307 # GCN-LABEL: name: accvgpr_write_agpr_mfma_read_srcc
308 # GCN: V_ACCVGPR_WRITE_B32
311 name: accvgpr_write_agpr_mfma_read_srcc
314 $agpr0 = V_ACCVGPR_WRITE_B32 killed $vgpr0, implicit $exec
315 $agpr4_agpr5_agpr6_agpr7 = V_MFMA_F32_4X4X1F32 killed $vgpr1, killed $vgpr2, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $exec
319 # GCN-LABEL: name: accvgpr_write_agpr_mfma_read_srca
320 # GCN: V_ACCVGPR_WRITE_B32
325 name: accvgpr_write_agpr_mfma_read_srca
328 $agpr8 = V_ACCVGPR_WRITE_B32 killed $vgpr0, implicit $exec
329 $agpr4_agpr5_agpr6_agpr7 = V_MFMA_F32_4X4X1F32 killed $agpr8, killed $vgpr1, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $exec
333 # GCN-LABEL: name: accvgpr_write_agpr_mfma_read_srcb
334 # GCN: V_ACCVGPR_WRITE_B32
339 name: accvgpr_write_agpr_mfma_read_srcb
342 $agpr8 = V_ACCVGPR_WRITE_B32 killed $vgpr0, implicit $exec
343 $agpr4_agpr5_agpr6_agpr7 = V_MFMA_F32_4X4X1F32 killed $vgpr1, killed $agpr8, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $exec
347 # GCN-LABEL: name: accvgpr_write_agpr_accvgpr_read
348 # GCN: V_ACCVGPR_WRITE_B32
352 # GCN-NEXT: V_ACCVGPR_READ_B32
353 name: accvgpr_write_agpr_accvgpr_read
356 $agpr0 = V_ACCVGPR_WRITE_B32 killed $vgpr0, implicit $exec
357 $vgpr1 = V_ACCVGPR_READ_B32 killed $agpr0, implicit $exec
361 # GCN-LABEL: name: vcmpx_write_exec_mfma
362 # GCN: V_CMPX_EQ_I32_e32
368 name: vcmpx_write_exec_mfma
371 implicit $exec, implicit $vcc = V_CMPX_EQ_I32_e32 $vgpr0, $vgpr1, implicit $exec
372 $agpr4_agpr5_agpr6_agpr7 = V_MFMA_F32_4X4X1F32 killed $agpr8, killed $vgpr1, killed $agpr0_agpr1_agpr2_agpr3, 0, 0, 0, implicit $exec
376 # GCN-LABEL: name: vcmpx_write_exec_accvgpr_write
377 # GCN: V_CMPX_EQ_I32_e32
382 # GCN-NEXT: V_ACCVGPR_WRITE_B32
383 name: vcmpx_write_exec_accvgpr_write
386 implicit $exec, implicit $vcc = V_CMPX_EQ_I32_e32 $vgpr0, $vgpr1, implicit $exec
387 $agpr0 = V_ACCVGPR_WRITE_B32 killed $vgpr2, implicit $exec
391 # GCN-LABEL: name: accvgpr_read_write_vgpr_load
392 # GCN: V_ACCVGPR_READ_B32
395 # GCN-NEXT: FLAT_LOAD_DWORD
396 name: accvgpr_read_write_vgpr_load
399 $vgpr0 = V_ACCVGPR_READ_B32 killed $agpr0, implicit $exec
400 $vgpr3 = FLAT_LOAD_DWORD $vgpr0_vgpr1, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
404 # GCN-LABEL: name: accvgpr_read_write_vgpr_store
405 # GCN: V_ACCVGPR_READ_B32
408 # GCN-NEXT: DS_WRITE_B32
409 name: accvgpr_read_write_vgpr_store
412 $vgpr0 = V_ACCVGPR_READ_B32 killed $agpr0, implicit $exec
413 DS_WRITE_B32 $vgpr0, $vgpr1, 0, 0, implicit $m0, implicit $exec
417 # GCN-LABEL: name: valu_write_vgpr_accvgpr_read_load_no_dependency
419 # GCN-NEXT: V_ACCVGPR_READ_B32
420 # GCN-NEXT: FLAT_LOAD_DWORD
421 name: valu_write_vgpr_accvgpr_read_load_no_dependency
424 $vgpr0 = V_MOV_B32_e32 1, implicit $exec
425 $vgpr1 = V_ACCVGPR_READ_B32 killed $agpr0, implicit $exec
426 $vgpr4 = FLAT_LOAD_DWORD $vgpr2_vgpr3, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
430 # GCN-LABEL: name: valu_write_vgpr_accvgpr_read_load_1_and_3_depend
432 # GCN-NEXT: V_ACCVGPR_READ_B32
434 # GCN-NEXT: FLAT_LOAD_DWORD
435 name: valu_write_vgpr_accvgpr_read_load_1_and_3_depend
438 $vgpr0 = V_MOV_B32_e32 1, implicit $exec
439 $vgpr2 = V_ACCVGPR_READ_B32 killed $agpr0, implicit $exec
440 $vgpr4 = FLAT_LOAD_DWORD $vgpr0_vgpr1, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
444 # GCN-LABEL: name: valu_write_vgpr_accvgpr_read_load_2_and_3_depend
446 # GCN-NEXT: V_ACCVGPR_READ_B32
449 # GCN-NEXT: FLAT_LOAD_DWORD
450 name: valu_write_vgpr_accvgpr_read_load_2_and_3_depend
453 $vgpr0 = V_MOV_B32_e32 1, implicit $exec
454 $vgpr2 = V_ACCVGPR_READ_B32 killed $agpr0, implicit $exec
455 $vgpr4 = FLAT_LOAD_DWORD $vgpr2_vgpr3, 0, 0, 0, 0, implicit $exec, implicit $flat_scr