1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn -mcpu=gfx908 -verify-machineinstrs -run-pass si-fold-operands %s -o - | FileCheck %s --check-prefixes=GFX908
3 # RUN: llc -mtriple=amdgcn -mcpu=gfx90a -verify-machineinstrs -run-pass si-fold-operands %s -o - | FileCheck %s --check-prefixes=GFX90A
4 # RUN: llc -mtriple=amdgcn -mcpu=gfx940 -verify-machineinstrs -run-pass si-fold-operands %s -o - | FileCheck %s --check-prefixes=GFX90A
7 name: test_sgpr_init_multiuse
8 tracksRegLiveness: true
11 ; GFX908-LABEL: name: test_sgpr_init_multiuse
13 ; GFX908-NEXT: successors: %bb.1(0x80000000)
14 ; GFX908-NEXT: liveins: $sgpr0, $scc
16 ; GFX908-NEXT: [[COPY:%[0-9]+]]:sgpr_32 = COPY $sgpr0
17 ; GFX908-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY [[COPY]]
18 ; GFX908-NEXT: [[V_ACCVGPR_WRITE_B32_e64_:%[0-9]+]]:agpr_32 = V_ACCVGPR_WRITE_B32_e64 [[COPY1]], implicit $exec
19 ; GFX908-NEXT: [[V_ACCVGPR_WRITE_B32_e64_1:%[0-9]+]]:agpr_32 = V_ACCVGPR_WRITE_B32_e64 [[COPY1]], implicit $exec
20 ; GFX908-NEXT: [[V_ACCVGPR_WRITE_B32_e64_2:%[0-9]+]]:agpr_32 = V_ACCVGPR_WRITE_B32_e64 [[COPY1]], implicit $exec
21 ; GFX908-NEXT: [[V_ACCVGPR_WRITE_B32_e64_3:%[0-9]+]]:agpr_32 = V_ACCVGPR_WRITE_B32_e64 [[COPY1]], implicit $exec
24 ; GFX908-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
25 ; GFX908-NEXT: liveins: $scc
27 ; GFX908-NEXT: [[PHI:%[0-9]+]]:agpr_32 = PHI [[V_ACCVGPR_WRITE_B32_e64_3]], %bb.0, %13.sub0, %bb.1
28 ; GFX908-NEXT: [[PHI1:%[0-9]+]]:agpr_32 = PHI [[V_ACCVGPR_WRITE_B32_e64_2]], %bb.0, %13.sub1, %bb.1
29 ; GFX908-NEXT: [[PHI2:%[0-9]+]]:agpr_32 = PHI [[V_ACCVGPR_WRITE_B32_e64_1]], %bb.0, %13.sub2, %bb.1
30 ; GFX908-NEXT: [[PHI3:%[0-9]+]]:agpr_32 = PHI [[V_ACCVGPR_WRITE_B32_e64_]], %bb.0, %13.sub3, %bb.1
31 ; GFX908-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY [[PHI3]]
32 ; GFX908-NEXT: [[COPY3:%[0-9]+]]:vgpr_32 = COPY [[PHI2]]
33 ; GFX908-NEXT: [[COPY4:%[0-9]+]]:vgpr_32 = COPY [[PHI1]]
34 ; GFX908-NEXT: [[COPY5:%[0-9]+]]:vgpr_32 = COPY [[PHI]]
35 ; GFX908-NEXT: [[REG_SEQUENCE:%[0-9]+]]:areg_128_align2 = REG_SEQUENCE [[COPY5]], %subreg.sub0, [[COPY4]], %subreg.sub1, [[COPY3]], %subreg.sub2, [[COPY2]], %subreg.sub3
36 ; GFX908-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1073741824, implicit $exec
37 ; GFX908-NEXT: [[V_MOV_B32_e32_1:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1065353216, implicit $exec
38 ; GFX908-NEXT: [[V_MFMA_F32_4X4X1F32_e64_:%[0-9]+]]:areg_128_align2 = V_MFMA_F32_4X4X1F32_e64 [[V_MOV_B32_e32_1]], [[V_MOV_B32_e32_]], [[REG_SEQUENCE]], 0, 0, 0, implicit $mode, implicit $exec
39 ; GFX908-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc
42 ; GFX908-NEXT: S_ENDPGM 0
44 ; GFX90A-LABEL: name: test_sgpr_init_multiuse
46 ; GFX90A-NEXT: successors: %bb.1(0x80000000)
47 ; GFX90A-NEXT: liveins: $sgpr0, $scc
49 ; GFX90A-NEXT: [[COPY:%[0-9]+]]:sgpr_32 = COPY $sgpr0
50 ; GFX90A-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY [[COPY]]
51 ; GFX90A-NEXT: [[COPY2:%[0-9]+]]:agpr_32 = COPY [[COPY1]]
52 ; GFX90A-NEXT: [[COPY3:%[0-9]+]]:agpr_32 = COPY [[COPY1]]
53 ; GFX90A-NEXT: [[COPY4:%[0-9]+]]:agpr_32 = COPY [[COPY1]]
54 ; GFX90A-NEXT: [[COPY5:%[0-9]+]]:agpr_32 = COPY [[COPY1]]
57 ; GFX90A-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
58 ; GFX90A-NEXT: liveins: $scc
60 ; GFX90A-NEXT: [[PHI:%[0-9]+]]:agpr_32 = PHI [[COPY5]], %bb.0, %13.sub0, %bb.1
61 ; GFX90A-NEXT: [[PHI1:%[0-9]+]]:agpr_32 = PHI [[COPY4]], %bb.0, %13.sub1, %bb.1
62 ; GFX90A-NEXT: [[PHI2:%[0-9]+]]:agpr_32 = PHI [[COPY3]], %bb.0, %13.sub2, %bb.1
63 ; GFX90A-NEXT: [[PHI3:%[0-9]+]]:agpr_32 = PHI [[COPY2]], %bb.0, %13.sub3, %bb.1
64 ; GFX90A-NEXT: [[COPY6:%[0-9]+]]:vgpr_32 = COPY [[PHI3]]
65 ; GFX90A-NEXT: [[COPY7:%[0-9]+]]:vgpr_32 = COPY [[PHI2]]
66 ; GFX90A-NEXT: [[COPY8:%[0-9]+]]:vgpr_32 = COPY [[PHI1]]
67 ; GFX90A-NEXT: [[COPY9:%[0-9]+]]:vgpr_32 = COPY [[PHI]]
68 ; GFX90A-NEXT: [[REG_SEQUENCE:%[0-9]+]]:areg_128_align2 = REG_SEQUENCE [[COPY9]], %subreg.sub0, [[COPY8]], %subreg.sub1, [[COPY7]], %subreg.sub2, [[COPY6]], %subreg.sub3
69 ; GFX90A-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1073741824, implicit $exec
70 ; GFX90A-NEXT: [[V_MOV_B32_e32_1:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1065353216, implicit $exec
71 ; GFX90A-NEXT: [[V_MFMA_F32_4X4X1F32_e64_:%[0-9]+]]:areg_128_align2 = V_MFMA_F32_4X4X1F32_e64 [[V_MOV_B32_e32_1]], [[V_MOV_B32_e32_]], [[REG_SEQUENCE]], 0, 0, 0, implicit $mode, implicit $exec
72 ; GFX90A-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc
75 ; GFX90A-NEXT: S_ENDPGM 0
80 %0:sgpr_32 = COPY $sgpr0
85 successors: %bb.1, %bb.2
87 %8:vgpr_32 = PHI %1, %bb.0, %16, %bb.1
88 %9:vgpr_32 = PHI %1, %bb.0, %17, %bb.1
89 %10:vgpr_32 = PHI %1, %bb.0, %18, %bb.1
90 %11:vgpr_32 = PHI %1, %bb.0, %19, %bb.1
91 %12:areg_128_align2 = REG_SEQUENCE %8, %subreg.sub0, %9, %subreg.sub1, %10, %subreg.sub2, %11, %subreg.sub3
92 %13:vgpr_32 = V_MOV_B32_e32 1073741824, implicit $exec
93 %14:vgpr_32 = V_MOV_B32_e32 1065353216, implicit $exec
94 %15:areg_128_align2 = V_MFMA_F32_4X4X1F32_e64 %14:vgpr_32, %13:vgpr_32, %12:areg_128_align2, 0, 0, 0, implicit $mode, implicit $exec
95 %16:vgpr_32 = COPY %15.sub0
96 %17:vgpr_32 = COPY %15.sub1
97 %18:vgpr_32 = COPY %15.sub2
98 %19:vgpr_32 = COPY %15.sub3
99 S_CBRANCH_SCC1 %bb.1, implicit $scc
106 name: test_sgpr_init_multiuse_agprtuple
107 tracksRegLiveness: true
110 ; GFX908-LABEL: name: test_sgpr_init_multiuse_agprtuple
112 ; GFX908-NEXT: successors: %bb.1(0x80000000)
113 ; GFX908-NEXT: liveins: $sgpr0_sgpr1, $scc
114 ; GFX908-NEXT: {{ $}}
115 ; GFX908-NEXT: [[COPY:%[0-9]+]]:sgpr_64 = COPY $sgpr0_sgpr1
116 ; GFX908-NEXT: [[COPY1:%[0-9]+]]:vreg_64_align2 = COPY [[COPY]]
117 ; GFX908-NEXT: [[COPY2:%[0-9]+]]:areg_64_align2 = COPY [[COPY1]]
118 ; GFX908-NEXT: [[COPY3:%[0-9]+]]:areg_64_align2 = COPY [[COPY1]]
119 ; GFX908-NEXT: {{ $}}
121 ; GFX908-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
122 ; GFX908-NEXT: liveins: $scc
123 ; GFX908-NEXT: {{ $}}
124 ; GFX908-NEXT: [[PHI:%[0-9]+]]:areg_64_align2 = PHI [[COPY3]], %bb.0, %9.sub0_sub1, %bb.1
125 ; GFX908-NEXT: [[PHI1:%[0-9]+]]:areg_64_align2 = PHI [[COPY2]], %bb.0, %9.sub2_sub3, %bb.1
126 ; GFX908-NEXT: [[COPY4:%[0-9]+]]:vreg_64_align2 = COPY [[PHI1]]
127 ; GFX908-NEXT: [[COPY5:%[0-9]+]]:vreg_64_align2 = COPY [[PHI]]
128 ; GFX908-NEXT: [[REG_SEQUENCE:%[0-9]+]]:areg_128_align2 = REG_SEQUENCE [[COPY5]].sub0, %subreg.sub0, [[COPY5]].sub1, %subreg.sub1, [[COPY4]].sub0, %subreg.sub2, [[COPY4]].sub1, %subreg.sub3
129 ; GFX908-NEXT: [[V_MOV_B64_e32_:%[0-9]+]]:vreg_64_align2 = V_MOV_B64_e32 1073741824, implicit $exec
130 ; GFX908-NEXT: [[V_MOV_B64_e32_1:%[0-9]+]]:vreg_64_align2 = V_MOV_B64_e32 1065353216, implicit $exec
131 ; GFX908-NEXT: [[V_MFMA_F32_4X4X1F32_e64_:%[0-9]+]]:areg_128_align2 = V_MFMA_F32_4X4X1F32_e64 [[V_MOV_B64_e32_1]].sub0, [[V_MOV_B64_e32_]].sub1, [[REG_SEQUENCE]], 0, 0, 0, implicit $mode, implicit $exec
132 ; GFX908-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc
133 ; GFX908-NEXT: {{ $}}
135 ; GFX908-NEXT: S_ENDPGM 0
137 ; GFX90A-LABEL: name: test_sgpr_init_multiuse_agprtuple
139 ; GFX90A-NEXT: successors: %bb.1(0x80000000)
140 ; GFX90A-NEXT: liveins: $sgpr0_sgpr1, $scc
141 ; GFX90A-NEXT: {{ $}}
142 ; GFX90A-NEXT: [[COPY:%[0-9]+]]:sgpr_64 = COPY $sgpr0_sgpr1
143 ; GFX90A-NEXT: [[COPY1:%[0-9]+]]:vreg_64_align2 = COPY [[COPY]]
144 ; GFX90A-NEXT: [[COPY2:%[0-9]+]]:areg_64_align2 = COPY [[COPY1]]
145 ; GFX90A-NEXT: [[COPY3:%[0-9]+]]:areg_64_align2 = COPY [[COPY1]]
146 ; GFX90A-NEXT: {{ $}}
148 ; GFX90A-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
149 ; GFX90A-NEXT: liveins: $scc
150 ; GFX90A-NEXT: {{ $}}
151 ; GFX90A-NEXT: [[PHI:%[0-9]+]]:areg_64_align2 = PHI [[COPY3]], %bb.0, %9.sub0_sub1, %bb.1
152 ; GFX90A-NEXT: [[PHI1:%[0-9]+]]:areg_64_align2 = PHI [[COPY2]], %bb.0, %9.sub2_sub3, %bb.1
153 ; GFX90A-NEXT: [[COPY4:%[0-9]+]]:vreg_64_align2 = COPY [[PHI1]]
154 ; GFX90A-NEXT: [[COPY5:%[0-9]+]]:vreg_64_align2 = COPY [[PHI]]
155 ; GFX90A-NEXT: [[REG_SEQUENCE:%[0-9]+]]:areg_128_align2 = REG_SEQUENCE [[COPY5]].sub0, %subreg.sub0, [[COPY5]].sub1, %subreg.sub1, [[COPY4]].sub0, %subreg.sub2, [[COPY4]].sub1, %subreg.sub3
156 ; GFX90A-NEXT: [[V_MOV_B64_e32_:%[0-9]+]]:vreg_64_align2 = V_MOV_B64_e32 1073741824, implicit $exec
157 ; GFX90A-NEXT: [[V_MOV_B64_e32_1:%[0-9]+]]:vreg_64_align2 = V_MOV_B64_e32 1065353216, implicit $exec
158 ; GFX90A-NEXT: [[V_MFMA_F32_4X4X1F32_e64_:%[0-9]+]]:areg_128_align2 = V_MFMA_F32_4X4X1F32_e64 [[V_MOV_B64_e32_1]].sub0, [[V_MOV_B64_e32_]].sub1, [[REG_SEQUENCE]], 0, 0, 0, implicit $mode, implicit $exec
159 ; GFX90A-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc
160 ; GFX90A-NEXT: {{ $}}
162 ; GFX90A-NEXT: S_ENDPGM 0
165 liveins: $sgpr0_sgpr1, $scc
167 %0:sgpr_64 = COPY $sgpr0_sgpr1
168 %1:vreg_64_align2 = COPY %0:sgpr_64
171 successors: %bb.1, %bb.2
174 %2:vreg_64_align2 = PHI %1, %bb.0, %3, %bb.1
175 %4:vreg_64_align2 = PHI %1, %bb.0, %5, %bb.1
176 %6:areg_128_align2 = REG_SEQUENCE %2.sub0, %subreg.sub0, %2.sub1, %subreg.sub1, %4.sub0, %subreg.sub2, %4.sub1, %subreg.sub3
177 %7:vreg_64_align2 = V_MOV_B64_e32 1073741824, implicit $exec
178 %8:vreg_64_align2 = V_MOV_B64_e32 1065353216, implicit $exec
179 %9:areg_128_align2 = V_MFMA_F32_4X4X1F32_e64 %8.sub0, %7.sub1, %6:areg_128_align2, 0, 0, 0, implicit $mode, implicit $exec
180 %3:vreg_64_align2 = COPY %9.sub0_sub1:areg_128_align2
181 %5:vreg_64_align2 = COPY %9.sub2_sub3:areg_128_align2
182 S_CBRANCH_SCC1 %bb.1, implicit $scc
190 name: test_sgpr_init_singleuse
191 tracksRegLiveness: true
194 ; GFX908-LABEL: name: test_sgpr_init_singleuse
196 ; GFX908-NEXT: successors: %bb.1(0x80000000)
197 ; GFX908-NEXT: liveins: $sgpr0, $scc
198 ; GFX908-NEXT: {{ $}}
199 ; GFX908-NEXT: [[COPY:%[0-9]+]]:sgpr_32 = COPY $sgpr0
200 ; GFX908-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY [[COPY]]
201 ; GFX908-NEXT: [[COPY2:%[0-9]+]]:agpr_32 = COPY [[COPY1]]
202 ; GFX908-NEXT: [[COPY3:%[0-9]+]]:vgpr_32 = COPY [[COPY]]
203 ; GFX908-NEXT: [[COPY4:%[0-9]+]]:agpr_32 = COPY [[COPY3]]
204 ; GFX908-NEXT: [[COPY5:%[0-9]+]]:vgpr_32 = COPY [[COPY]]
205 ; GFX908-NEXT: [[COPY6:%[0-9]+]]:agpr_32 = COPY [[COPY5]]
206 ; GFX908-NEXT: [[COPY7:%[0-9]+]]:vgpr_32 = COPY [[COPY]]
207 ; GFX908-NEXT: [[COPY8:%[0-9]+]]:agpr_32 = COPY [[COPY7]]
208 ; GFX908-NEXT: {{ $}}
210 ; GFX908-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
211 ; GFX908-NEXT: liveins: $scc
212 ; GFX908-NEXT: {{ $}}
213 ; GFX908-NEXT: [[PHI:%[0-9]+]]:agpr_32 = PHI [[COPY2]], %bb.0, %16.sub0, %bb.1
214 ; GFX908-NEXT: [[PHI1:%[0-9]+]]:agpr_32 = PHI [[COPY4]], %bb.0, %16.sub1, %bb.1
215 ; GFX908-NEXT: [[PHI2:%[0-9]+]]:agpr_32 = PHI [[COPY6]], %bb.0, %16.sub2, %bb.1
216 ; GFX908-NEXT: [[PHI3:%[0-9]+]]:agpr_32 = PHI [[COPY8]], %bb.0, %16.sub3, %bb.1
217 ; GFX908-NEXT: [[COPY9:%[0-9]+]]:vgpr_32 = COPY [[PHI3]]
218 ; GFX908-NEXT: [[COPY10:%[0-9]+]]:vgpr_32 = COPY [[PHI2]]
219 ; GFX908-NEXT: [[COPY11:%[0-9]+]]:vgpr_32 = COPY [[PHI1]]
220 ; GFX908-NEXT: [[COPY12:%[0-9]+]]:vgpr_32 = COPY [[PHI]]
221 ; GFX908-NEXT: [[REG_SEQUENCE:%[0-9]+]]:areg_128_align2 = REG_SEQUENCE [[COPY12]], %subreg.sub0, [[COPY11]], %subreg.sub1, [[COPY10]], %subreg.sub2, [[COPY9]], %subreg.sub3
222 ; GFX908-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1073741824, implicit $exec
223 ; GFX908-NEXT: [[V_MOV_B32_e32_1:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1065353216, implicit $exec
224 ; GFX908-NEXT: [[V_MFMA_F32_4X4X1F32_e64_:%[0-9]+]]:areg_128_align2 = V_MFMA_F32_4X4X1F32_e64 [[V_MOV_B32_e32_1]], [[V_MOV_B32_e32_]], [[REG_SEQUENCE]], 0, 0, 0, implicit $mode, implicit $exec
225 ; GFX908-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc
226 ; GFX908-NEXT: {{ $}}
228 ; GFX908-NEXT: S_ENDPGM 0
230 ; GFX90A-LABEL: name: test_sgpr_init_singleuse
232 ; GFX90A-NEXT: successors: %bb.1(0x80000000)
233 ; GFX90A-NEXT: liveins: $sgpr0, $scc
234 ; GFX90A-NEXT: {{ $}}
235 ; GFX90A-NEXT: [[COPY:%[0-9]+]]:sgpr_32 = COPY $sgpr0
236 ; GFX90A-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY [[COPY]]
237 ; GFX90A-NEXT: [[COPY2:%[0-9]+]]:agpr_32 = COPY [[COPY1]]
238 ; GFX90A-NEXT: [[COPY3:%[0-9]+]]:vgpr_32 = COPY [[COPY]]
239 ; GFX90A-NEXT: [[COPY4:%[0-9]+]]:agpr_32 = COPY [[COPY3]]
240 ; GFX90A-NEXT: [[COPY5:%[0-9]+]]:vgpr_32 = COPY [[COPY]]
241 ; GFX90A-NEXT: [[COPY6:%[0-9]+]]:agpr_32 = COPY [[COPY5]]
242 ; GFX90A-NEXT: [[COPY7:%[0-9]+]]:vgpr_32 = COPY [[COPY]]
243 ; GFX90A-NEXT: [[COPY8:%[0-9]+]]:agpr_32 = COPY [[COPY7]]
244 ; GFX90A-NEXT: {{ $}}
246 ; GFX90A-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
247 ; GFX90A-NEXT: liveins: $scc
248 ; GFX90A-NEXT: {{ $}}
249 ; GFX90A-NEXT: [[PHI:%[0-9]+]]:agpr_32 = PHI [[COPY2]], %bb.0, %16.sub0, %bb.1
250 ; GFX90A-NEXT: [[PHI1:%[0-9]+]]:agpr_32 = PHI [[COPY4]], %bb.0, %16.sub1, %bb.1
251 ; GFX90A-NEXT: [[PHI2:%[0-9]+]]:agpr_32 = PHI [[COPY6]], %bb.0, %16.sub2, %bb.1
252 ; GFX90A-NEXT: [[PHI3:%[0-9]+]]:agpr_32 = PHI [[COPY8]], %bb.0, %16.sub3, %bb.1
253 ; GFX90A-NEXT: [[COPY9:%[0-9]+]]:vgpr_32 = COPY [[PHI3]]
254 ; GFX90A-NEXT: [[COPY10:%[0-9]+]]:vgpr_32 = COPY [[PHI2]]
255 ; GFX90A-NEXT: [[COPY11:%[0-9]+]]:vgpr_32 = COPY [[PHI1]]
256 ; GFX90A-NEXT: [[COPY12:%[0-9]+]]:vgpr_32 = COPY [[PHI]]
257 ; GFX90A-NEXT: [[REG_SEQUENCE:%[0-9]+]]:areg_128_align2 = REG_SEQUENCE [[COPY12]], %subreg.sub0, [[COPY11]], %subreg.sub1, [[COPY10]], %subreg.sub2, [[COPY9]], %subreg.sub3
258 ; GFX90A-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1073741824, implicit $exec
259 ; GFX90A-NEXT: [[V_MOV_B32_e32_1:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1065353216, implicit $exec
260 ; GFX90A-NEXT: [[V_MFMA_F32_4X4X1F32_e64_:%[0-9]+]]:areg_128_align2 = V_MFMA_F32_4X4X1F32_e64 [[V_MOV_B32_e32_1]], [[V_MOV_B32_e32_]], [[REG_SEQUENCE]], 0, 0, 0, implicit $mode, implicit $exec
261 ; GFX90A-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc
262 ; GFX90A-NEXT: {{ $}}
264 ; GFX90A-NEXT: S_ENDPGM 0
266 liveins: $sgpr0, $scc
269 %0:sgpr_32 = COPY $sgpr0
277 successors: %bb.1, %bb.2
279 %8:vgpr_32 = PHI %1, %bb.0, %16, %bb.1
280 %9:vgpr_32 = PHI %2, %bb.0, %17, %bb.1
281 %10:vgpr_32 = PHI %3, %bb.0, %18, %bb.1
282 %11:vgpr_32 = PHI %4, %bb.0, %19, %bb.1
283 %12:areg_128_align2 = REG_SEQUENCE %8, %subreg.sub0, %9, %subreg.sub1, %10, %subreg.sub2, %11, %subreg.sub3
284 %13:vgpr_32 = V_MOV_B32_e32 1073741824, implicit $exec
285 %14:vgpr_32 = V_MOV_B32_e32 1065353216, implicit $exec
286 %15:areg_128_align2 = V_MFMA_F32_4X4X1F32_e64 %14:vgpr_32, %13:vgpr_32, %12:areg_128_align2, 0, 0, 0, implicit $mode, implicit $exec
287 %16:vgpr_32 = COPY %15.sub0
288 %17:vgpr_32 = COPY %15.sub1
289 %18:vgpr_32 = COPY %15.sub2
290 %19:vgpr_32 = COPY %15.sub3
291 S_CBRANCH_SCC1 %bb.1, implicit $scc
299 tracksRegLiveness: true
302 ; GFX908-LABEL: name: test_vgpr_init
304 ; GFX908-NEXT: successors: %bb.1(0x80000000)
305 ; GFX908-NEXT: liveins: $vgpr0, $scc
306 ; GFX908-NEXT: {{ $}}
307 ; GFX908-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
308 ; GFX908-NEXT: [[COPY1:%[0-9]+]]:agpr_32 = COPY [[COPY]]
309 ; GFX908-NEXT: [[COPY2:%[0-9]+]]:agpr_32 = COPY [[COPY]]
310 ; GFX908-NEXT: [[COPY3:%[0-9]+]]:agpr_32 = COPY [[COPY]]
311 ; GFX908-NEXT: [[COPY4:%[0-9]+]]:agpr_32 = COPY [[COPY]]
312 ; GFX908-NEXT: {{ $}}
314 ; GFX908-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
315 ; GFX908-NEXT: liveins: $scc
316 ; GFX908-NEXT: {{ $}}
317 ; GFX908-NEXT: [[PHI:%[0-9]+]]:agpr_32 = PHI [[COPY4]], %bb.0, %12.sub0, %bb.1
318 ; GFX908-NEXT: [[PHI1:%[0-9]+]]:agpr_32 = PHI [[COPY3]], %bb.0, %12.sub1, %bb.1
319 ; GFX908-NEXT: [[PHI2:%[0-9]+]]:agpr_32 = PHI [[COPY2]], %bb.0, %12.sub2, %bb.1
320 ; GFX908-NEXT: [[PHI3:%[0-9]+]]:agpr_32 = PHI [[COPY1]], %bb.0, %12.sub3, %bb.1
321 ; GFX908-NEXT: [[COPY5:%[0-9]+]]:vgpr_32 = COPY [[PHI3]]
322 ; GFX908-NEXT: [[COPY6:%[0-9]+]]:vgpr_32 = COPY [[PHI2]]
323 ; GFX908-NEXT: [[COPY7:%[0-9]+]]:vgpr_32 = COPY [[PHI1]]
324 ; GFX908-NEXT: [[COPY8:%[0-9]+]]:vgpr_32 = COPY [[PHI]]
325 ; GFX908-NEXT: [[REG_SEQUENCE:%[0-9]+]]:areg_128_align2 = REG_SEQUENCE [[COPY8]], %subreg.sub0, [[COPY7]], %subreg.sub1, [[COPY6]], %subreg.sub2, [[COPY5]], %subreg.sub3
326 ; GFX908-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1073741824, implicit $exec
327 ; GFX908-NEXT: [[V_MOV_B32_e32_1:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1065353216, implicit $exec
328 ; GFX908-NEXT: [[V_MFMA_F32_4X4X1F32_e64_:%[0-9]+]]:areg_128_align2 = V_MFMA_F32_4X4X1F32_e64 [[V_MOV_B32_e32_1]], [[V_MOV_B32_e32_]], [[REG_SEQUENCE]], 0, 0, 0, implicit $mode, implicit $exec
329 ; GFX908-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc
330 ; GFX908-NEXT: {{ $}}
332 ; GFX908-NEXT: S_ENDPGM 0
334 ; GFX90A-LABEL: name: test_vgpr_init
336 ; GFX90A-NEXT: successors: %bb.1(0x80000000)
337 ; GFX90A-NEXT: liveins: $vgpr0, $scc
338 ; GFX90A-NEXT: {{ $}}
339 ; GFX90A-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
340 ; GFX90A-NEXT: [[COPY1:%[0-9]+]]:agpr_32 = COPY [[COPY]]
341 ; GFX90A-NEXT: [[COPY2:%[0-9]+]]:agpr_32 = COPY [[COPY]]
342 ; GFX90A-NEXT: [[COPY3:%[0-9]+]]:agpr_32 = COPY [[COPY]]
343 ; GFX90A-NEXT: [[COPY4:%[0-9]+]]:agpr_32 = COPY [[COPY]]
344 ; GFX90A-NEXT: {{ $}}
346 ; GFX90A-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
347 ; GFX90A-NEXT: liveins: $scc
348 ; GFX90A-NEXT: {{ $}}
349 ; GFX90A-NEXT: [[PHI:%[0-9]+]]:agpr_32 = PHI [[COPY4]], %bb.0, %12.sub0, %bb.1
350 ; GFX90A-NEXT: [[PHI1:%[0-9]+]]:agpr_32 = PHI [[COPY3]], %bb.0, %12.sub1, %bb.1
351 ; GFX90A-NEXT: [[PHI2:%[0-9]+]]:agpr_32 = PHI [[COPY2]], %bb.0, %12.sub2, %bb.1
352 ; GFX90A-NEXT: [[PHI3:%[0-9]+]]:agpr_32 = PHI [[COPY1]], %bb.0, %12.sub3, %bb.1
353 ; GFX90A-NEXT: [[COPY5:%[0-9]+]]:vgpr_32 = COPY [[PHI3]]
354 ; GFX90A-NEXT: [[COPY6:%[0-9]+]]:vgpr_32 = COPY [[PHI2]]
355 ; GFX90A-NEXT: [[COPY7:%[0-9]+]]:vgpr_32 = COPY [[PHI1]]
356 ; GFX90A-NEXT: [[COPY8:%[0-9]+]]:vgpr_32 = COPY [[PHI]]
357 ; GFX90A-NEXT: [[REG_SEQUENCE:%[0-9]+]]:areg_128_align2 = REG_SEQUENCE [[COPY8]], %subreg.sub0, [[COPY7]], %subreg.sub1, [[COPY6]], %subreg.sub2, [[COPY5]], %subreg.sub3
358 ; GFX90A-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1073741824, implicit $exec
359 ; GFX90A-NEXT: [[V_MOV_B32_e32_1:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1065353216, implicit $exec
360 ; GFX90A-NEXT: [[V_MFMA_F32_4X4X1F32_e64_:%[0-9]+]]:areg_128_align2 = V_MFMA_F32_4X4X1F32_e64 [[V_MOV_B32_e32_1]], [[V_MOV_B32_e32_]], [[REG_SEQUENCE]], 0, 0, 0, implicit $mode, implicit $exec
361 ; GFX90A-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc
362 ; GFX90A-NEXT: {{ $}}
364 ; GFX90A-NEXT: S_ENDPGM 0
366 liveins: $vgpr0, $scc
369 %0:vgpr_32 = COPY $vgpr0
373 successors: %bb.1, %bb.2
375 %8:vgpr_32 = PHI %0, %bb.0, %16, %bb.1
376 %9:vgpr_32 = PHI %0, %bb.0, %17, %bb.1
377 %10:vgpr_32 = PHI %0, %bb.0, %18, %bb.1
378 %11:vgpr_32 = PHI %0, %bb.0, %19, %bb.1
379 %12:areg_128_align2 = REG_SEQUENCE %8, %subreg.sub0, %9, %subreg.sub1, %10, %subreg.sub2, %11, %subreg.sub3
380 %13:vgpr_32 = V_MOV_B32_e32 1073741824, implicit $exec
381 %14:vgpr_32 = V_MOV_B32_e32 1065353216, implicit $exec
382 %15:areg_128_align2 = V_MFMA_F32_4X4X1F32_e64 %14:vgpr_32, %13:vgpr_32, %12:areg_128_align2, 0, 0, 0, implicit $mode, implicit $exec
383 %16:vgpr_32 = COPY %15.sub0
384 %17:vgpr_32 = COPY %15.sub1
385 %18:vgpr_32 = COPY %15.sub2
386 %19:vgpr_32 = COPY %15.sub3
387 S_CBRANCH_SCC1 %bb.1, implicit $scc
394 name: test_use_vgpr_temp
395 tracksRegLiveness: true
398 ; GFX908-LABEL: name: test_use_vgpr_temp
400 ; GFX908-NEXT: successors: %bb.1(0x80000000)
401 ; GFX908-NEXT: liveins: $sgpr0, $scc
402 ; GFX908-NEXT: {{ $}}
403 ; GFX908-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $sgpr0
404 ; GFX908-NEXT: [[V_ACCVGPR_WRITE_B32_e64_:%[0-9]+]]:agpr_32 = V_ACCVGPR_WRITE_B32_e64 [[COPY]], implicit $exec
405 ; GFX908-NEXT: [[V_ACCVGPR_WRITE_B32_e64_1:%[0-9]+]]:agpr_32 = V_ACCVGPR_WRITE_B32_e64 [[COPY]], implicit $exec
406 ; GFX908-NEXT: [[V_ACCVGPR_WRITE_B32_e64_2:%[0-9]+]]:agpr_32 = V_ACCVGPR_WRITE_B32_e64 [[COPY]], implicit $exec
407 ; GFX908-NEXT: [[V_ACCVGPR_WRITE_B32_e64_3:%[0-9]+]]:agpr_32 = V_ACCVGPR_WRITE_B32_e64 [[COPY]], implicit $exec
408 ; GFX908-NEXT: [[REG_SEQUENCE:%[0-9]+]]:areg_128_align2 = REG_SEQUENCE [[V_ACCVGPR_WRITE_B32_e64_]], %subreg.sub0, [[V_ACCVGPR_WRITE_B32_e64_1]], %subreg.sub1, [[V_ACCVGPR_WRITE_B32_e64_2]], %subreg.sub2, [[V_ACCVGPR_WRITE_B32_e64_3]], %subreg.sub3
409 ; GFX908-NEXT: [[V_ACCVGPR_READ_B32_e64_:%[0-9]+]]:vgpr_32 = V_ACCVGPR_READ_B32_e64 [[REG_SEQUENCE]].sub0, implicit $exec
410 ; GFX908-NEXT: [[COPY1:%[0-9]+]]:agpr_32 = COPY [[V_ACCVGPR_READ_B32_e64_]]
411 ; GFX908-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY [[REG_SEQUENCE]].sub0
412 ; GFX908-NEXT: {{ $}}
414 ; GFX908-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
415 ; GFX908-NEXT: liveins: $scc
416 ; GFX908-NEXT: {{ $}}
417 ; GFX908-NEXT: [[PHI:%[0-9]+]]:agpr_32 = PHI [[COPY1]], %bb.0, %18.sub0, %bb.1
418 ; GFX908-NEXT: [[PHI1:%[0-9]+]]:agpr_32 = PHI [[COPY1]], %bb.0, %18.sub1, %bb.1
419 ; GFX908-NEXT: [[PHI2:%[0-9]+]]:agpr_32 = PHI [[COPY1]], %bb.0, %18.sub2, %bb.1
420 ; GFX908-NEXT: [[PHI3:%[0-9]+]]:agpr_32 = PHI [[COPY1]], %bb.0, %18.sub3, %bb.1
421 ; GFX908-NEXT: [[COPY3:%[0-9]+]]:vgpr_32 = COPY [[PHI3]]
422 ; GFX908-NEXT: [[COPY4:%[0-9]+]]:vgpr_32 = COPY [[PHI2]]
423 ; GFX908-NEXT: [[COPY5:%[0-9]+]]:vgpr_32 = COPY [[PHI1]]
424 ; GFX908-NEXT: [[COPY6:%[0-9]+]]:vgpr_32 = COPY [[PHI]]
425 ; GFX908-NEXT: [[REG_SEQUENCE1:%[0-9]+]]:areg_128_align2 = REG_SEQUENCE [[COPY6]], %subreg.sub0, [[COPY5]], %subreg.sub1, [[COPY4]], %subreg.sub2, [[COPY3]], %subreg.sub3
426 ; GFX908-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1073741824, implicit $exec
427 ; GFX908-NEXT: [[V_MOV_B32_e32_1:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1065353216, implicit $exec
428 ; GFX908-NEXT: [[V_MFMA_F32_4X4X1F32_e64_:%[0-9]+]]:areg_128_align2 = V_MFMA_F32_4X4X1F32_e64 [[V_MOV_B32_e32_1]], [[V_MOV_B32_e32_]], [[REG_SEQUENCE1]], 0, 0, 0, implicit $mode, implicit $exec
429 ; GFX908-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc
430 ; GFX908-NEXT: {{ $}}
432 ; GFX908-NEXT: S_ENDPGM 0
434 ; GFX90A-LABEL: name: test_use_vgpr_temp
436 ; GFX90A-NEXT: successors: %bb.1(0x80000000)
437 ; GFX90A-NEXT: liveins: $sgpr0, $scc
438 ; GFX90A-NEXT: {{ $}}
439 ; GFX90A-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $sgpr0
440 ; GFX90A-NEXT: [[V_ACCVGPR_WRITE_B32_e64_:%[0-9]+]]:agpr_32 = V_ACCVGPR_WRITE_B32_e64 [[COPY]], implicit $exec
441 ; GFX90A-NEXT: [[V_ACCVGPR_WRITE_B32_e64_1:%[0-9]+]]:agpr_32 = V_ACCVGPR_WRITE_B32_e64 [[COPY]], implicit $exec
442 ; GFX90A-NEXT: [[V_ACCVGPR_WRITE_B32_e64_2:%[0-9]+]]:agpr_32 = V_ACCVGPR_WRITE_B32_e64 [[COPY]], implicit $exec
443 ; GFX90A-NEXT: [[V_ACCVGPR_WRITE_B32_e64_3:%[0-9]+]]:agpr_32 = V_ACCVGPR_WRITE_B32_e64 [[COPY]], implicit $exec
444 ; GFX90A-NEXT: [[REG_SEQUENCE:%[0-9]+]]:areg_128_align2 = REG_SEQUENCE [[V_ACCVGPR_WRITE_B32_e64_]], %subreg.sub0, [[V_ACCVGPR_WRITE_B32_e64_1]], %subreg.sub1, [[V_ACCVGPR_WRITE_B32_e64_2]], %subreg.sub2, [[V_ACCVGPR_WRITE_B32_e64_3]], %subreg.sub3
445 ; GFX90A-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY [[REG_SEQUENCE]].sub0
446 ; GFX90A-NEXT: {{ $}}
448 ; GFX90A-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
449 ; GFX90A-NEXT: liveins: $scc
450 ; GFX90A-NEXT: {{ $}}
451 ; GFX90A-NEXT: [[PHI:%[0-9]+]]:agpr_32 = PHI [[REG_SEQUENCE]].sub0, %bb.0, %18.sub0, %bb.1
452 ; GFX90A-NEXT: [[PHI1:%[0-9]+]]:agpr_32 = PHI [[REG_SEQUENCE]].sub0, %bb.0, %18.sub1, %bb.1
453 ; GFX90A-NEXT: [[PHI2:%[0-9]+]]:agpr_32 = PHI [[REG_SEQUENCE]].sub0, %bb.0, %18.sub2, %bb.1
454 ; GFX90A-NEXT: [[PHI3:%[0-9]+]]:agpr_32 = PHI [[REG_SEQUENCE]].sub0, %bb.0, %18.sub3, %bb.1
455 ; GFX90A-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY [[PHI3]]
456 ; GFX90A-NEXT: [[COPY3:%[0-9]+]]:vgpr_32 = COPY [[PHI2]]
457 ; GFX90A-NEXT: [[COPY4:%[0-9]+]]:vgpr_32 = COPY [[PHI1]]
458 ; GFX90A-NEXT: [[COPY5:%[0-9]+]]:vgpr_32 = COPY [[PHI]]
459 ; GFX90A-NEXT: [[REG_SEQUENCE1:%[0-9]+]]:areg_128_align2 = REG_SEQUENCE [[COPY5]], %subreg.sub0, [[COPY4]], %subreg.sub1, [[COPY3]], %subreg.sub2, [[COPY2]], %subreg.sub3
460 ; GFX90A-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1073741824, implicit $exec
461 ; GFX90A-NEXT: [[V_MOV_B32_e32_1:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1065353216, implicit $exec
462 ; GFX90A-NEXT: [[V_MFMA_F32_4X4X1F32_e64_:%[0-9]+]]:areg_128_align2 = V_MFMA_F32_4X4X1F32_e64 [[V_MOV_B32_e32_1]], [[V_MOV_B32_e32_]], [[REG_SEQUENCE1]], 0, 0, 0, implicit $mode, implicit $exec
463 ; GFX90A-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc
464 ; GFX90A-NEXT: {{ $}}
466 ; GFX90A-NEXT: S_ENDPGM 0
468 liveins: $sgpr0, $scc
471 %1:vgpr_32 = COPY $sgpr0
472 %2:agpr_32 = V_ACCVGPR_WRITE_B32_e64 %1, implicit $exec
473 %3:agpr_32 = V_ACCVGPR_WRITE_B32_e64 %1, implicit $exec
474 %4:agpr_32 = V_ACCVGPR_WRITE_B32_e64 %1, implicit $exec
475 %5:agpr_32 = V_ACCVGPR_WRITE_B32_e64 %1, implicit $exec
476 %6:areg_128_align2 = REG_SEQUENCE %2, %subreg.sub0, %3, %subreg.sub1, %4, %subreg.sub2, %5, %subreg.sub3
477 %7:vgpr_32 = COPY %6.sub0
480 successors: %bb.1, %bb.2
482 %8:vgpr_32 = PHI %7, %bb.0, %16, %bb.1
483 %9:vgpr_32 = PHI %7, %bb.0, %17, %bb.1
484 %10:vgpr_32 = PHI %7, %bb.0, %18, %bb.1
485 %11:vgpr_32 = PHI %7, %bb.0, %19, %bb.1
486 %12:areg_128_align2 = REG_SEQUENCE %8, %subreg.sub0, %9, %subreg.sub1, %10, %subreg.sub2, %11, %subreg.sub3
487 %13:vgpr_32 = V_MOV_B32_e32 1073741824, implicit $exec
488 %14:vgpr_32 = V_MOV_B32_e32 1065353216, implicit $exec
489 %15:areg_128_align2 = V_MFMA_F32_4X4X1F32_e64 %14:vgpr_32, %13:vgpr_32, %12:areg_128_align2, 0, 0, 0, implicit $mode, implicit $exec
490 %16:vgpr_32 = COPY %15.sub0
491 %17:vgpr_32 = COPY %15.sub1
492 %18:vgpr_32 = COPY %15.sub2
493 %19:vgpr_32 = COPY %15.sub3
494 S_CBRANCH_SCC1 %bb.1, implicit $scc
500 name: test_vgpr_init_two_copies
501 tracksRegLiveness: true
504 ; GFX908-LABEL: name: test_vgpr_init_two_copies
506 ; GFX908-NEXT: successors: %bb.1(0x80000000)
507 ; GFX908-NEXT: liveins: $vgpr0, $scc
508 ; GFX908-NEXT: {{ $}}
509 ; GFX908-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
510 ; GFX908-NEXT: [[COPY1:%[0-9]+]]:agpr_32 = COPY [[COPY]]
511 ; GFX908-NEXT: [[COPY2:%[0-9]+]]:agpr_32 = COPY [[COPY]]
512 ; GFX908-NEXT: [[COPY3:%[0-9]+]]:agpr_32 = COPY [[COPY]]
513 ; GFX908-NEXT: [[COPY4:%[0-9]+]]:agpr_32 = COPY [[COPY]]
514 ; GFX908-NEXT: {{ $}}
516 ; GFX908-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
517 ; GFX908-NEXT: liveins: $scc
518 ; GFX908-NEXT: {{ $}}
519 ; GFX908-NEXT: [[PHI:%[0-9]+]]:agpr_32 = PHI [[COPY4]], %bb.0, %12.sub0, %bb.1
520 ; GFX908-NEXT: [[PHI1:%[0-9]+]]:agpr_32 = PHI [[COPY3]], %bb.0, %12.sub1, %bb.1
521 ; GFX908-NEXT: [[PHI2:%[0-9]+]]:agpr_32 = PHI [[COPY2]], %bb.0, %12.sub2, %bb.1
522 ; GFX908-NEXT: [[PHI3:%[0-9]+]]:agpr_32 = PHI [[COPY1]], %bb.0, %12.sub3, %bb.1
523 ; GFX908-NEXT: [[COPY5:%[0-9]+]]:vgpr_32 = COPY [[PHI3]]
524 ; GFX908-NEXT: [[COPY6:%[0-9]+]]:vgpr_32 = COPY [[PHI2]]
525 ; GFX908-NEXT: [[COPY7:%[0-9]+]]:vgpr_32 = COPY [[PHI1]]
526 ; GFX908-NEXT: [[COPY8:%[0-9]+]]:vgpr_32 = COPY [[PHI]]
527 ; GFX908-NEXT: [[REG_SEQUENCE:%[0-9]+]]:areg_128_align2 = REG_SEQUENCE [[COPY8]], %subreg.sub0, [[COPY7]], %subreg.sub1, [[COPY6]], %subreg.sub2, [[COPY5]], %subreg.sub3
528 ; GFX908-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1073741824, implicit $exec
529 ; GFX908-NEXT: [[V_MOV_B32_e32_1:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1065353216, implicit $exec
530 ; GFX908-NEXT: [[V_MFMA_F32_4X4X1F32_e64_:%[0-9]+]]:areg_128_align2 = V_MFMA_F32_4X4X1F32_e64 [[V_MOV_B32_e32_1]], [[V_MOV_B32_e32_]], [[REG_SEQUENCE]], 0, 0, 0, implicit $mode, implicit $exec
531 ; GFX908-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc
532 ; GFX908-NEXT: {{ $}}
534 ; GFX908-NEXT: S_ENDPGM 0
536 ; GFX90A-LABEL: name: test_vgpr_init_two_copies
538 ; GFX90A-NEXT: successors: %bb.1(0x80000000)
539 ; GFX90A-NEXT: liveins: $vgpr0, $scc
540 ; GFX90A-NEXT: {{ $}}
541 ; GFX90A-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
542 ; GFX90A-NEXT: [[COPY1:%[0-9]+]]:agpr_32 = COPY [[COPY]]
543 ; GFX90A-NEXT: [[COPY2:%[0-9]+]]:agpr_32 = COPY [[COPY]]
544 ; GFX90A-NEXT: [[COPY3:%[0-9]+]]:agpr_32 = COPY [[COPY]]
545 ; GFX90A-NEXT: [[COPY4:%[0-9]+]]:agpr_32 = COPY [[COPY]]
546 ; GFX90A-NEXT: {{ $}}
548 ; GFX90A-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
549 ; GFX90A-NEXT: liveins: $scc
550 ; GFX90A-NEXT: {{ $}}
551 ; GFX90A-NEXT: [[PHI:%[0-9]+]]:agpr_32 = PHI [[COPY4]], %bb.0, %12.sub0, %bb.1
552 ; GFX90A-NEXT: [[PHI1:%[0-9]+]]:agpr_32 = PHI [[COPY3]], %bb.0, %12.sub1, %bb.1
553 ; GFX90A-NEXT: [[PHI2:%[0-9]+]]:agpr_32 = PHI [[COPY2]], %bb.0, %12.sub2, %bb.1
554 ; GFX90A-NEXT: [[PHI3:%[0-9]+]]:agpr_32 = PHI [[COPY1]], %bb.0, %12.sub3, %bb.1
555 ; GFX90A-NEXT: [[COPY5:%[0-9]+]]:vgpr_32 = COPY [[PHI3]]
556 ; GFX90A-NEXT: [[COPY6:%[0-9]+]]:vgpr_32 = COPY [[PHI2]]
557 ; GFX90A-NEXT: [[COPY7:%[0-9]+]]:vgpr_32 = COPY [[PHI1]]
558 ; GFX90A-NEXT: [[COPY8:%[0-9]+]]:vgpr_32 = COPY [[PHI]]
559 ; GFX90A-NEXT: [[REG_SEQUENCE:%[0-9]+]]:areg_128_align2 = REG_SEQUENCE [[COPY8]], %subreg.sub0, [[COPY7]], %subreg.sub1, [[COPY6]], %subreg.sub2, [[COPY5]], %subreg.sub3
560 ; GFX90A-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1073741824, implicit $exec
561 ; GFX90A-NEXT: [[V_MOV_B32_e32_1:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1065353216, implicit $exec
562 ; GFX90A-NEXT: [[V_MFMA_F32_4X4X1F32_e64_:%[0-9]+]]:areg_128_align2 = V_MFMA_F32_4X4X1F32_e64 [[V_MOV_B32_e32_1]], [[V_MOV_B32_e32_]], [[REG_SEQUENCE]], 0, 0, 0, implicit $mode, implicit $exec
563 ; GFX90A-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc
564 ; GFX90A-NEXT: {{ $}}
566 ; GFX90A-NEXT: S_ENDPGM 0
568 liveins: $vgpr0, $scc
571 %0:vgpr_32 = COPY $vgpr0
575 successors: %bb.1, %bb.2
577 %8:vgpr_32 = PHI %0, %bb.0, %17, %bb.1
578 %9:vgpr_32 = PHI %0, %bb.0, %18, %bb.1
579 %10:vgpr_32 = PHI %0, %bb.0, %19, %bb.1
580 %11:vgpr_32 = PHI %0, %bb.0, %20, %bb.1
581 %12:areg_128_align2 = REG_SEQUENCE %8, %subreg.sub0, %9, %subreg.sub1, %10, %subreg.sub2, %11, %subreg.sub3
582 %13:vgpr_32 = V_MOV_B32_e32 1073741824, implicit $exec
583 %14:vgpr_32 = V_MOV_B32_e32 1065353216, implicit $exec
584 %15:areg_128_align2 = V_MFMA_F32_4X4X1F32_e64 %14:vgpr_32, %13:vgpr_32, %12:areg_128_align2, 0, 0, 0, implicit $mode, implicit $exec
585 %16:vreg_128_align2 = COPY %15:areg_128_align2
586 %17:vgpr_32 = COPY %16.sub0:vreg_128_align2
587 %18:vgpr_32 = COPY %16.sub1:vreg_128_align2
588 %19:vgpr_32 = COPY %16.sub2:vreg_128_align2
589 %20:vgpr_32 = COPY %16.sub3:vreg_128_align2
590 S_CBRANCH_SCC1 %bb.1, implicit $scc
597 name: test_vgpr_init_skip_phis_insertpt
598 tracksRegLiveness: true
601 ; GFX908-LABEL: name: test_vgpr_init_skip_phis_insertpt
603 ; GFX908-NEXT: successors: %bb.1(0x80000000)
604 ; GFX908-NEXT: liveins: $vgpr0, $vgpr1, $scc
605 ; GFX908-NEXT: {{ $}}
606 ; GFX908-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
607 ; GFX908-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr0
608 ; GFX908-NEXT: {{ $}}
610 ; GFX908-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
611 ; GFX908-NEXT: liveins: $scc
612 ; GFX908-NEXT: {{ $}}
613 ; GFX908-NEXT: [[PHI:%[0-9]+]]:vgpr_32 = PHI [[COPY]], %bb.0, [[COPY1]], %bb.1
614 ; GFX908-NEXT: [[PHI1:%[0-9]+]]:vgpr_32 = PHI [[COPY]], %bb.0, [[COPY1]], %bb.1
615 ; GFX908-NEXT: [[COPY2:%[0-9]+]]:agpr_32 = COPY [[PHI]]
616 ; GFX908-NEXT: [[COPY3:%[0-9]+]]:agpr_32 = COPY [[PHI]]
617 ; GFX908-NEXT: [[COPY4:%[0-9]+]]:agpr_32 = COPY [[PHI]]
618 ; GFX908-NEXT: [[COPY5:%[0-9]+]]:agpr_32 = COPY [[PHI]]
619 ; GFX908-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc
620 ; GFX908-NEXT: {{ $}}
622 ; GFX908-NEXT: successors: %bb.2(0x40000000), %bb.3(0x40000000)
623 ; GFX908-NEXT: liveins: $scc
624 ; GFX908-NEXT: {{ $}}
625 ; GFX908-NEXT: [[PHI2:%[0-9]+]]:agpr_32 = PHI [[COPY5]], %bb.1, %15.sub0, %bb.2
626 ; GFX908-NEXT: [[PHI3:%[0-9]+]]:agpr_32 = PHI [[COPY4]], %bb.1, %15.sub1, %bb.2
627 ; GFX908-NEXT: [[PHI4:%[0-9]+]]:agpr_32 = PHI [[COPY3]], %bb.1, %15.sub2, %bb.2
628 ; GFX908-NEXT: [[PHI5:%[0-9]+]]:agpr_32 = PHI [[COPY2]], %bb.1, %15.sub3, %bb.2
629 ; GFX908-NEXT: [[COPY6:%[0-9]+]]:vgpr_32 = COPY [[PHI5]]
630 ; GFX908-NEXT: [[COPY7:%[0-9]+]]:vgpr_32 = COPY [[PHI4]]
631 ; GFX908-NEXT: [[COPY8:%[0-9]+]]:vgpr_32 = COPY [[PHI3]]
632 ; GFX908-NEXT: [[COPY9:%[0-9]+]]:vgpr_32 = COPY [[PHI2]]
633 ; GFX908-NEXT: [[REG_SEQUENCE:%[0-9]+]]:areg_128_align2 = REG_SEQUENCE [[COPY9]], %subreg.sub0, [[COPY8]], %subreg.sub1, [[COPY7]], %subreg.sub2, [[COPY6]], %subreg.sub3
634 ; GFX908-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1073741824, implicit $exec
635 ; GFX908-NEXT: [[V_MOV_B32_e32_1:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1065353216, implicit $exec
636 ; GFX908-NEXT: [[V_MFMA_F32_4X4X1F32_e64_:%[0-9]+]]:areg_128_align2 = V_MFMA_F32_4X4X1F32_e64 [[V_MOV_B32_e32_1]], [[V_MOV_B32_e32_]], [[REG_SEQUENCE]], 0, 0, 0, implicit $mode, implicit $exec
637 ; GFX908-NEXT: S_CBRANCH_SCC1 %bb.2, implicit $scc
638 ; GFX908-NEXT: {{ $}}
640 ; GFX908-NEXT: S_ENDPGM 0
642 ; GFX90A-LABEL: name: test_vgpr_init_skip_phis_insertpt
644 ; GFX90A-NEXT: successors: %bb.1(0x80000000)
645 ; GFX90A-NEXT: liveins: $vgpr0, $vgpr1, $scc
646 ; GFX90A-NEXT: {{ $}}
647 ; GFX90A-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
648 ; GFX90A-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr0
649 ; GFX90A-NEXT: {{ $}}
651 ; GFX90A-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
652 ; GFX90A-NEXT: liveins: $scc
653 ; GFX90A-NEXT: {{ $}}
654 ; GFX90A-NEXT: [[PHI:%[0-9]+]]:vgpr_32 = PHI [[COPY]], %bb.0, [[COPY1]], %bb.1
655 ; GFX90A-NEXT: [[PHI1:%[0-9]+]]:vgpr_32 = PHI [[COPY]], %bb.0, [[COPY1]], %bb.1
656 ; GFX90A-NEXT: [[COPY2:%[0-9]+]]:agpr_32 = COPY [[PHI]]
657 ; GFX90A-NEXT: [[COPY3:%[0-9]+]]:agpr_32 = COPY [[PHI]]
658 ; GFX90A-NEXT: [[COPY4:%[0-9]+]]:agpr_32 = COPY [[PHI]]
659 ; GFX90A-NEXT: [[COPY5:%[0-9]+]]:agpr_32 = COPY [[PHI]]
660 ; GFX90A-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc
661 ; GFX90A-NEXT: {{ $}}
663 ; GFX90A-NEXT: successors: %bb.2(0x40000000), %bb.3(0x40000000)
664 ; GFX90A-NEXT: liveins: $scc
665 ; GFX90A-NEXT: {{ $}}
666 ; GFX90A-NEXT: [[PHI2:%[0-9]+]]:agpr_32 = PHI [[COPY5]], %bb.1, %15.sub0, %bb.2
667 ; GFX90A-NEXT: [[PHI3:%[0-9]+]]:agpr_32 = PHI [[COPY4]], %bb.1, %15.sub1, %bb.2
668 ; GFX90A-NEXT: [[PHI4:%[0-9]+]]:agpr_32 = PHI [[COPY3]], %bb.1, %15.sub2, %bb.2
669 ; GFX90A-NEXT: [[PHI5:%[0-9]+]]:agpr_32 = PHI [[COPY2]], %bb.1, %15.sub3, %bb.2
670 ; GFX90A-NEXT: [[COPY6:%[0-9]+]]:vgpr_32 = COPY [[PHI5]]
671 ; GFX90A-NEXT: [[COPY7:%[0-9]+]]:vgpr_32 = COPY [[PHI4]]
672 ; GFX90A-NEXT: [[COPY8:%[0-9]+]]:vgpr_32 = COPY [[PHI3]]
673 ; GFX90A-NEXT: [[COPY9:%[0-9]+]]:vgpr_32 = COPY [[PHI2]]
674 ; GFX90A-NEXT: [[REG_SEQUENCE:%[0-9]+]]:areg_128_align2 = REG_SEQUENCE [[COPY9]], %subreg.sub0, [[COPY8]], %subreg.sub1, [[COPY7]], %subreg.sub2, [[COPY6]], %subreg.sub3
675 ; GFX90A-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1073741824, implicit $exec
676 ; GFX90A-NEXT: [[V_MOV_B32_e32_1:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1065353216, implicit $exec
677 ; GFX90A-NEXT: [[V_MFMA_F32_4X4X1F32_e64_:%[0-9]+]]:areg_128_align2 = V_MFMA_F32_4X4X1F32_e64 [[V_MOV_B32_e32_1]], [[V_MOV_B32_e32_]], [[REG_SEQUENCE]], 0, 0, 0, implicit $mode, implicit $exec
678 ; GFX90A-NEXT: S_CBRANCH_SCC1 %bb.2, implicit $scc
679 ; GFX90A-NEXT: {{ $}}
681 ; GFX90A-NEXT: S_ENDPGM 0
683 liveins: $vgpr0, $vgpr1, $scc
686 %0:vgpr_32 = COPY $vgpr0
687 %1:vgpr_32 = COPY $vgpr0
691 successors: %bb.1, %bb.2
693 %6:vgpr_32 = PHI %0, %bb.0, %1, %bb.1
694 %7:vgpr_32 = PHI %0, %bb.0, %1, %bb.1
695 S_CBRANCH_SCC1 %bb.1, implicit $scc
699 successors: %bb.2, %bb.3
700 %8:vgpr_32 = PHI %6, %bb.1, %16, %bb.2
701 %9:vgpr_32 = PHI %6, %bb.1, %17, %bb.2
702 %10:vgpr_32 = PHI %6, %bb.1, %18, %bb.2
703 %11:vgpr_32 = PHI %6, %bb.1, %19, %bb.2
704 %12:areg_128_align2 = REG_SEQUENCE %8, %subreg.sub0, %9, %subreg.sub1, %10, %subreg.sub2, %11, %subreg.sub3
705 %13:vgpr_32 = V_MOV_B32_e32 1073741824, implicit $exec
706 %14:vgpr_32 = V_MOV_B32_e32 1065353216, implicit $exec
707 %15:areg_128_align2 = V_MFMA_F32_4X4X1F32_e64 %14:vgpr_32, %13:vgpr_32, %12:areg_128_align2, 0, 0, 0, implicit $mode, implicit $exec
708 %16:vgpr_32 = COPY %15.sub0
709 %17:vgpr_32 = COPY %15.sub1
710 %18:vgpr_32 = COPY %15.sub2
711 %19:vgpr_32 = COPY %15.sub3
712 S_CBRANCH_SCC1 %bb.2, implicit $scc
719 name: skip_optimize_agpr_phi_without_subreg_use
720 tracksRegLiveness: true
722 ; GFX908-LABEL: name: skip_optimize_agpr_phi_without_subreg_use
724 ; GFX908-NEXT: successors: %bb.1(0x80000000)
725 ; GFX908-NEXT: liveins: $scc
726 ; GFX908-NEXT: {{ $}}
727 ; GFX908-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
728 ; GFX908-NEXT: [[S_MOV_B32_:%[0-9]+]]:sgpr_32 = S_MOV_B32 0
729 ; GFX908-NEXT: [[V_ACCVGPR_WRITE_B32_e64_:%[0-9]+]]:agpr_32 = V_ACCVGPR_WRITE_B32_e64 0, implicit $exec
730 ; GFX908-NEXT: [[V_ACCVGPR_WRITE_B32_e64_1:%[0-9]+]]:agpr_32 = V_ACCVGPR_WRITE_B32_e64 0, implicit $exec
731 ; GFX908-NEXT: [[V_ACCVGPR_WRITE_B32_e64_2:%[0-9]+]]:agpr_32 = V_ACCVGPR_WRITE_B32_e64 0, implicit $exec
732 ; GFX908-NEXT: [[V_ACCVGPR_WRITE_B32_e64_3:%[0-9]+]]:agpr_32 = V_ACCVGPR_WRITE_B32_e64 0, implicit $exec
733 ; GFX908-NEXT: [[REG_SEQUENCE:%[0-9]+]]:areg_128_align2 = REG_SEQUENCE [[V_ACCVGPR_WRITE_B32_e64_]], %subreg.sub0, [[V_ACCVGPR_WRITE_B32_e64_1]], %subreg.sub1, [[V_ACCVGPR_WRITE_B32_e64_2]], %subreg.sub2, [[V_ACCVGPR_WRITE_B32_e64_3]], %subreg.sub3
734 ; GFX908-NEXT: {{ $}}
736 ; GFX908-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
737 ; GFX908-NEXT: liveins: $scc
738 ; GFX908-NEXT: {{ $}}
739 ; GFX908-NEXT: [[PHI:%[0-9]+]]:areg_128_align2 = PHI [[REG_SEQUENCE]], %bb.0, %7, %bb.1
740 ; GFX908-NEXT: [[V_MFMA_F32_16X16X4F32_e64_:%[0-9]+]]:areg_128_align2 = V_MFMA_F32_16X16X4F32_e64 [[V_MOV_B32_e32_]], [[V_MOV_B32_e32_]], [[PHI]], 0, 0, 0, implicit $mode, implicit $exec
741 ; GFX908-NEXT: [[COPY:%[0-9]+]]:areg_128_align2 = COPY [[V_MFMA_F32_16X16X4F32_e64_]], implicit $exec
742 ; GFX908-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc
743 ; GFX908-NEXT: {{ $}}
745 ; GFX908-NEXT: S_ENDPGM 0
747 ; GFX90A-LABEL: name: skip_optimize_agpr_phi_without_subreg_use
749 ; GFX90A-NEXT: successors: %bb.1(0x80000000)
750 ; GFX90A-NEXT: liveins: $scc
751 ; GFX90A-NEXT: {{ $}}
752 ; GFX90A-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
753 ; GFX90A-NEXT: [[S_MOV_B32_:%[0-9]+]]:sgpr_32 = S_MOV_B32 0
754 ; GFX90A-NEXT: [[V_ACCVGPR_WRITE_B32_e64_:%[0-9]+]]:agpr_32 = V_ACCVGPR_WRITE_B32_e64 0, implicit $exec
755 ; GFX90A-NEXT: [[V_ACCVGPR_WRITE_B32_e64_1:%[0-9]+]]:agpr_32 = V_ACCVGPR_WRITE_B32_e64 0, implicit $exec
756 ; GFX90A-NEXT: [[V_ACCVGPR_WRITE_B32_e64_2:%[0-9]+]]:agpr_32 = V_ACCVGPR_WRITE_B32_e64 0, implicit $exec
757 ; GFX90A-NEXT: [[V_ACCVGPR_WRITE_B32_e64_3:%[0-9]+]]:agpr_32 = V_ACCVGPR_WRITE_B32_e64 0, implicit $exec
758 ; GFX90A-NEXT: [[REG_SEQUENCE:%[0-9]+]]:areg_128_align2 = REG_SEQUENCE [[V_ACCVGPR_WRITE_B32_e64_]], %subreg.sub0, [[V_ACCVGPR_WRITE_B32_e64_1]], %subreg.sub1, [[V_ACCVGPR_WRITE_B32_e64_2]], %subreg.sub2, [[V_ACCVGPR_WRITE_B32_e64_3]], %subreg.sub3
759 ; GFX90A-NEXT: {{ $}}
761 ; GFX90A-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
762 ; GFX90A-NEXT: liveins: $scc
763 ; GFX90A-NEXT: {{ $}}
764 ; GFX90A-NEXT: [[PHI:%[0-9]+]]:areg_128_align2 = PHI [[REG_SEQUENCE]], %bb.0, %7, %bb.1
765 ; GFX90A-NEXT: [[V_MFMA_F32_16X16X4F32_e64_:%[0-9]+]]:areg_128_align2 = V_MFMA_F32_16X16X4F32_e64 [[V_MOV_B32_e32_]], [[V_MOV_B32_e32_]], [[PHI]], 0, 0, 0, implicit $mode, implicit $exec
766 ; GFX90A-NEXT: [[COPY:%[0-9]+]]:areg_128_align2 = COPY [[V_MFMA_F32_16X16X4F32_e64_]], implicit $exec
767 ; GFX90A-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc
768 ; GFX90A-NEXT: {{ $}}
770 ; GFX90A-NEXT: S_ENDPGM 0
775 %0:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
776 %1:sgpr_32 = S_MOV_B32 0
777 %2:sgpr_128 = REG_SEQUENCE %1, %subreg.sub0, %1, %subreg.sub1, %1, %subreg.sub2, %1, %subreg.sub3
778 %3:vreg_128 = COPY %2
779 %4:sreg_64 = S_MOV_B64 0
780 %5:areg_128_align2 = COPY %3, implicit $exec
784 successors: %bb.1, %bb.2
786 %9:areg_128_align2 = PHI %5, %bb.0, %10, %bb.1
787 %11:areg_128_align2 = V_MFMA_F32_16X16X4F32_e64 %0:vgpr_32, %0:vgpr_32, %9:areg_128_align2, 0, 0, 0, implicit $mode, implicit $exec
788 %12:vgpr_32 = COPY %11.sub3
789 %13:vgpr_32 = COPY %11.sub2
790 %14:vgpr_32 = COPY %11.sub1
791 %15:vgpr_32 = COPY %11.sub0
792 %10:areg_128_align2 = COPY %11, implicit $exec
793 S_CBRANCH_SCC1 %bb.1, implicit $scc