1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=gfx908 -run-pass=liveintervals,amdgpu-pre-ra-optimizations -verify-machineinstrs %s -o - | FileCheck -check-prefix=GFX908 %s
5 name: test_mfma_f32_4x4x1f32_propagate_vgpr
6 tracksRegLiveness: true
11 ; GFX908-LABEL: name: test_mfma_f32_4x4x1f32_propagate_vgpr
12 ; GFX908: liveins: $sgpr0_sgpr1
14 ; GFX908-NEXT: [[COPY:%[0-9]+]]:sgpr_64(p4) = COPY $sgpr0_sgpr1
15 ; GFX908-NEXT: [[S_LOAD_DWORDX2_IMM:%[0-9]+]]:sreg_64_xexec = S_LOAD_DWORDX2_IMM [[COPY]](p4), 36, 0 :: (dereferenceable invariant load (s64), align 4, addrspace 4)
16 ; GFX908-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
17 ; GFX908-NEXT: [[V_MOV_B32_e32_1:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1123418112, implicit $exec
18 ; GFX908-NEXT: undef %4.sub0:areg_128 = V_ACCVGPR_WRITE_B32_e64 [[V_MOV_B32_e32_1]], implicit $exec
19 ; GFX908-NEXT: %4.sub1:areg_128 = COPY [[V_MOV_B32_e32_1]]
20 ; GFX908-NEXT: %4.sub2:areg_128 = COPY [[V_MOV_B32_e32_1]]
21 ; GFX908-NEXT: %4.sub3:areg_128 = COPY [[V_MOV_B32_e32_1]]
22 ; GFX908-NEXT: [[V_MOV_B32_e32_2:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1073741824, implicit $exec
23 ; GFX908-NEXT: [[V_MOV_B32_e32_3:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1065353216, implicit $exec
24 ; GFX908-NEXT: [[V_MFMA_F32_4X4X1F32_e64_:%[0-9]+]]:areg_128 = V_MFMA_F32_4X4X1F32_e64 [[V_MOV_B32_e32_3]], [[V_MOV_B32_e32_2]], %4, 0, 0, 0, implicit $mode, implicit $exec
25 ; GFX908-NEXT: [[COPY1:%[0-9]+]]:vreg_128 = COPY [[V_MFMA_F32_4X4X1F32_e64_]]
26 ; GFX908-NEXT: GLOBAL_STORE_DWORDX4_SADDR [[V_MOV_B32_e32_]], [[COPY1]], [[S_LOAD_DWORDX2_IMM]], 0, 0, implicit $exec :: (store (s128), addrspace 1)
27 ; GFX908-NEXT: S_ENDPGM 0
28 %1:sgpr_64(p4) = COPY $sgpr0_sgpr1
29 %4:sreg_64_xexec = S_LOAD_DWORDX2_IMM %1:sgpr_64(p4), 36, 0 :: (dereferenceable invariant load (s64), align 4, addrspace 4)
30 %5:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
31 %13:vgpr_32 = V_MOV_B32_e32 1123418112, implicit $exec
32 undef %11.sub0:areg_128 = V_ACCVGPR_WRITE_B32_e64 %13:vgpr_32, implicit $exec
33 %11.sub1:areg_128 = COPY %11.sub0:areg_128
34 %11.sub2:areg_128 = COPY %11.sub0:areg_128
35 %11.sub3:areg_128 = COPY %11.sub0:areg_128
36 %8:vgpr_32 = V_MOV_B32_e32 1073741824, implicit $exec
37 %9:vgpr_32 = V_MOV_B32_e32 1065353216, implicit $exec
38 %10:areg_128 = V_MFMA_F32_4X4X1F32_e64 %9:vgpr_32, %8:vgpr_32, %11:areg_128, 0, 0, 0, implicit $mode, implicit $exec
39 %12:vreg_128 = COPY %10:areg_128
40 GLOBAL_STORE_DWORDX4_SADDR %5:vgpr_32, %12:vreg_128, %4:sreg_64_xexec, 0, 0, implicit $exec :: (store (s128), addrspace 1)
44 name: test_mfma_f32_4x4x1f32_no_propagate_imm
45 tracksRegLiveness: true
50 ; GFX908-LABEL: name: test_mfma_f32_4x4x1f32_no_propagate_imm
51 ; GFX908: liveins: $sgpr0_sgpr1
53 ; GFX908-NEXT: [[COPY:%[0-9]+]]:sgpr_64(p4) = COPY $sgpr0_sgpr1
54 ; GFX908-NEXT: [[S_LOAD_DWORDX2_IMM:%[0-9]+]]:sreg_64_xexec = S_LOAD_DWORDX2_IMM [[COPY]](p4), 36, 0 :: (dereferenceable invariant load (s64), align 4, addrspace 4)
55 ; GFX908-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
56 ; GFX908-NEXT: undef %3.sub0:areg_128 = V_ACCVGPR_WRITE_B32_e64 1073741824, implicit $exec
57 ; GFX908-NEXT: %3.sub1:areg_128 = COPY %3.sub0
58 ; GFX908-NEXT: %3.sub2:areg_128 = COPY %3.sub0
59 ; GFX908-NEXT: %3.sub3:areg_128 = COPY %3.sub0
60 ; GFX908-NEXT: [[V_MOV_B32_e32_1:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1073741824, implicit $exec
61 ; GFX908-NEXT: [[V_MOV_B32_e32_2:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1065353216, implicit $exec
62 ; GFX908-NEXT: [[V_MFMA_F32_4X4X1F32_e64_:%[0-9]+]]:areg_128 = V_MFMA_F32_4X4X1F32_e64 [[V_MOV_B32_e32_2]], [[V_MOV_B32_e32_1]], %3, 0, 0, 0, implicit $mode, implicit $exec
63 ; GFX908-NEXT: [[COPY1:%[0-9]+]]:vreg_128 = COPY [[V_MFMA_F32_4X4X1F32_e64_]]
64 ; GFX908-NEXT: GLOBAL_STORE_DWORDX4_SADDR [[V_MOV_B32_e32_]], [[COPY1]], [[S_LOAD_DWORDX2_IMM]], 0, 0, implicit $exec :: (store (s128), addrspace 1)
65 ; GFX908-NEXT: S_ENDPGM 0
66 %1:sgpr_64(p4) = COPY $sgpr0_sgpr1
67 %4:sreg_64_xexec = S_LOAD_DWORDX2_IMM %1:sgpr_64(p4), 36, 0 :: (dereferenceable invariant load (s64), align 4, addrspace 4)
68 %5:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
69 undef %11.sub0:areg_128 = V_ACCVGPR_WRITE_B32_e64 1073741824, implicit $exec
70 %11.sub1:areg_128 = COPY %11.sub0:areg_128
71 %11.sub2:areg_128 = COPY %11.sub0:areg_128
72 %11.sub3:areg_128 = COPY %11.sub0:areg_128
73 %8:vgpr_32 = V_MOV_B32_e32 1073741824, implicit $exec
74 %9:vgpr_32 = V_MOV_B32_e32 1065353216, implicit $exec
75 %10:areg_128 = V_MFMA_F32_4X4X1F32_e64 %9:vgpr_32, %8:vgpr_32, %11:areg_128, 0, 0, 0, implicit $mode, implicit $exec
76 %12:vreg_128 = COPY %10:areg_128
77 GLOBAL_STORE_DWORDX4_SADDR %5:vgpr_32, %12:vreg_128, %4:sreg_64_xexec, 0, 0, implicit $exec :: (store (s128), addrspace 1)
81 name: test_vgpr_subreg_propagate
82 tracksRegLiveness: true
86 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
87 ; GFX908-LABEL: name: test_vgpr_subreg_propagate
88 ; GFX908: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
90 ; GFX908-NEXT: [[COPY:%[0-9]+]]:vreg_128 = COPY $vgpr0_vgpr1_vgpr2_vgpr3, implicit $exec
91 ; GFX908-NEXT: undef %1.sub0:areg_128 = V_ACCVGPR_WRITE_B32_e64 [[COPY]].sub0, implicit $exec
92 ; GFX908-NEXT: %1.sub1:areg_128 = COPY [[COPY]].sub0
93 ; GFX908-NEXT: %1.sub2:areg_128 = COPY [[COPY]].sub0
94 ; GFX908-NEXT: %1.sub3:areg_128 = COPY [[COPY]].sub0
95 ; GFX908-NEXT: S_ENDPGM 0, implicit [[COPY]], implicit %1
96 %0:vreg_128 = COPY $vgpr0_vgpr1_vgpr2_vgpr3, implicit $exec
97 undef %1.sub0:areg_128 = V_ACCVGPR_WRITE_B32_e64 %0.sub0, implicit $exec
98 %1.sub1:areg_128 = COPY %1.sub0:areg_128
99 %1.sub2:areg_128 = COPY %1.sub0:areg_128
100 %1.sub3:areg_128 = COPY %1.sub0:areg_128
101 S_ENDPGM 0, implicit %0, implicit %1
104 name: test_nonmatching_agpr_subreg_no_propagate
105 tracksRegLiveness: true
109 liveins: $vgpr0_vgpr1
110 ; GFX908-LABEL: name: test_nonmatching_agpr_subreg_no_propagate
111 ; GFX908: liveins: $vgpr0_vgpr1
112 ; GFX908-NEXT: {{ $}}
113 ; GFX908-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1, implicit $exec
114 ; GFX908-NEXT: undef %1.sub0:areg_64 = V_ACCVGPR_WRITE_B32_e64 [[COPY]].sub0, implicit $exec
115 ; GFX908-NEXT: %1.sub1:areg_64 = V_ACCVGPR_WRITE_B32_e64 [[COPY]].sub1, implicit $exec
116 ; GFX908-NEXT: [[COPY1:%[0-9]+]]:areg_64 = COPY %1
117 ; GFX908-NEXT: S_ENDPGM 0, implicit [[COPY]], implicit %1, implicit [[COPY1]]
118 %0:vreg_64 = COPY $vgpr0_vgpr1, implicit $exec
119 undef %1.sub0:areg_64 = V_ACCVGPR_WRITE_B32_e64 %0.sub0, implicit $exec
120 %1.sub1:areg_64 = V_ACCVGPR_WRITE_B32_e64 %0.sub1, implicit $exec
121 %2:areg_64 = COPY %1:areg_64
122 S_ENDPGM 0, implicit %0, implicit %1, implicit %2
125 name: test_subreg_to_single_agpr_reg_propagate
126 tracksRegLiveness: true
130 liveins: $vgpr0_vgpr1
131 ; GFX908-LABEL: name: test_subreg_to_single_agpr_reg_propagate
132 ; GFX908: liveins: $vgpr0_vgpr1
133 ; GFX908-NEXT: {{ $}}
134 ; GFX908-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1, implicit $exec
135 ; GFX908-NEXT: undef %1.sub0:areg_64 = V_ACCVGPR_WRITE_B32_e64 [[COPY]].sub0, implicit $exec
136 ; GFX908-NEXT: %1.sub1:areg_64 = V_ACCVGPR_WRITE_B32_e64 [[COPY]].sub1, implicit $exec
137 ; GFX908-NEXT: [[COPY1:%[0-9]+]]:agpr_32 = COPY [[COPY]].sub1
138 ; GFX908-NEXT: S_ENDPGM 0, implicit [[COPY]], implicit %1, implicit [[COPY1]]
139 %0:vreg_64 = COPY $vgpr0_vgpr1, implicit $exec
140 undef %1.sub0:areg_64 = V_ACCVGPR_WRITE_B32_e64 %0.sub0, implicit $exec
141 %1.sub1:areg_64 = V_ACCVGPR_WRITE_B32_e64 %0.sub1, implicit $exec
142 %2:agpr_32 = COPY %1.sub1:areg_64
143 S_ENDPGM 0, implicit %0, implicit %1, implicit %2