1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=tahiti -run-pass=instruction-select -global-isel-abort=2 -pass-remarks-missed='gisel*' -o - %s | FileCheck -check-prefix=GCN %s
5 name: test_unmerge_values_v_s32_v_s32_v_s64
8 tracksRegLiveness: true
14 ; GCN-LABEL: name: test_unmerge_values_v_s32_v_s32_v_s64
15 ; GCN: liveins: $vgpr0_vgpr1
17 ; GCN-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
18 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY [[COPY]].sub0
19 ; GCN-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY [[COPY]].sub1
20 ; GCN-NEXT: S_ENDPGM 0, implicit [[COPY1]], implicit [[COPY2]]
21 %0:vgpr(s64) = COPY $vgpr0_vgpr1
22 %1:vgpr(s32), %2:vgpr(s32) = G_UNMERGE_VALUES %0
23 S_ENDPGM 0, implicit %1, implicit %2
27 name: test_unmerge_values_s_s32_s_s32_s_s64
30 tracksRegLiveness: true
36 ; GCN-LABEL: name: test_unmerge_values_s_s32_s_s32_s_s64
37 ; GCN: liveins: $sgpr0_sgpr1
39 ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
40 ; GCN-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY [[COPY]].sub0
41 ; GCN-NEXT: [[COPY2:%[0-9]+]]:sreg_32 = COPY [[COPY]].sub1
42 ; GCN-NEXT: S_ENDPGM 0, implicit [[COPY1]], implicit [[COPY2]]
43 %0:sgpr(s64) = COPY $sgpr0_sgpr1
44 %1:sgpr(s32), %2:sgpr(s32) = G_UNMERGE_VALUES %0
45 S_ENDPGM 0, implicit %1, implicit %2
49 name: test_unmerge_values_v_s32_s_s32_s_s64
52 tracksRegLiveness: true
58 ; GCN-LABEL: name: test_unmerge_values_v_s32_s_s32_s_s64
59 ; GCN: liveins: $sgpr0_sgpr1
61 ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
62 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY [[COPY]].sub0
63 ; GCN-NEXT: [[COPY2:%[0-9]+]]:sreg_32 = COPY [[COPY]].sub1
64 ; GCN-NEXT: S_ENDPGM 0, implicit [[COPY1]], implicit [[COPY2]]
65 %0:sgpr(s64) = COPY $sgpr0_sgpr1
66 %1:vgpr(s32), %2:sgpr(s32) = G_UNMERGE_VALUES %0
67 S_ENDPGM 0, implicit %1, implicit %2
71 name: test_unmerge_values_s_s32_v_s32_s_s64
74 tracksRegLiveness: true
80 ; GCN-LABEL: name: test_unmerge_values_s_s32_v_s32_s_s64
81 ; GCN: liveins: $sgpr0_sgpr1
83 ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
84 ; GCN-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY [[COPY]].sub0
85 ; GCN-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY [[COPY]].sub1
86 ; GCN-NEXT: S_ENDPGM 0, implicit [[COPY1]], implicit [[COPY2]]
87 %0:sgpr(s64) = COPY $sgpr0_sgpr1
88 %1:sgpr(s32), %2:vgpr(s32) = G_UNMERGE_VALUES %0
89 S_ENDPGM 0, implicit %1, implicit %2
93 name: test_unmerge_values_s_s32_s_s32_s32_s_s96
96 tracksRegLiveness: true
100 liveins: $sgpr0_sgpr1_sgpr2
102 ; GCN-LABEL: name: test_unmerge_values_s_s32_s_s32_s32_s_s96
103 ; GCN: liveins: $sgpr0_sgpr1_sgpr2
105 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr_96 = COPY $sgpr0_sgpr1_sgpr2
106 ; GCN-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY [[COPY]].sub0
107 ; GCN-NEXT: [[COPY2:%[0-9]+]]:sreg_32 = COPY [[COPY]].sub1
108 ; GCN-NEXT: [[COPY3:%[0-9]+]]:sreg_32 = COPY [[COPY]].sub2
109 ; GCN-NEXT: S_ENDPGM 0, implicit [[COPY1]], implicit [[COPY2]], implicit [[COPY3]]
110 %0:sgpr(s96) = COPY $sgpr0_sgpr1_sgpr2
111 %1:sgpr(s32), %2:sgpr(s32), %3:sgpr(s32) = G_UNMERGE_VALUES %0
112 S_ENDPGM 0, implicit %1, implicit %2, implicit %3
116 name: test_unmerge_values_s_s32_s_s32_s32_s_s32_s_s128
118 regBankSelected: true
119 tracksRegLiveness: true
123 liveins: $sgpr0_sgpr1_sgpr2_sgpr3
125 ; GCN-LABEL: name: test_unmerge_values_s_s32_s_s32_s32_s_s32_s_s128
126 ; GCN: liveins: $sgpr0_sgpr1_sgpr2_sgpr3
128 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr_128 = COPY $sgpr0_sgpr1_sgpr2_sgpr3
129 ; GCN-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY [[COPY]].sub0
130 ; GCN-NEXT: [[COPY2:%[0-9]+]]:sreg_32 = COPY [[COPY]].sub1
131 ; GCN-NEXT: [[COPY3:%[0-9]+]]:sreg_32 = COPY [[COPY]].sub2
132 ; GCN-NEXT: [[COPY4:%[0-9]+]]:sreg_32 = COPY [[COPY]].sub3
133 ; GCN-NEXT: S_ENDPGM 0, implicit [[COPY1]], implicit [[COPY2]], implicit [[COPY3]], implicit [[COPY4]]
134 %0:sgpr(s128) = COPY $sgpr0_sgpr1_sgpr2_sgpr3
135 %1:sgpr(s32), %2:sgpr(s32), %3:sgpr(s32), %4:sgpr(s32) = G_UNMERGE_VALUES %0
136 S_ENDPGM 0, implicit %1, implicit %2, implicit %3, implicit %4
140 name: test_unmerge_values_s_s64_s_s64_s_s128
142 regBankSelected: true
143 tracksRegLiveness: true
147 liveins: $sgpr0_sgpr1_sgpr2_sgpr3
149 ; GCN-LABEL: name: test_unmerge_values_s_s64_s_s64_s_s128
150 ; GCN: liveins: $sgpr0_sgpr1_sgpr2_sgpr3
152 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr_128 = COPY $sgpr0_sgpr1_sgpr2_sgpr3
153 ; GCN-NEXT: [[COPY1:%[0-9]+]]:sreg_64 = COPY [[COPY]].sub0_sub1
154 ; GCN-NEXT: [[COPY2:%[0-9]+]]:sreg_64 = COPY [[COPY]].sub2_sub3
155 ; GCN-NEXT: S_ENDPGM 0, implicit [[COPY1]], implicit [[COPY2]]
156 %0:sgpr(s128) = COPY $sgpr0_sgpr1_sgpr2_sgpr3
157 %1:sgpr(s64), %2:sgpr(s64) = G_UNMERGE_VALUES %0
158 S_ENDPGM 0, implicit %1, implicit %2
162 name: test_unmerge_values_s_s64_s_s64_s64_s_s192
164 regBankSelected: true
165 tracksRegLiveness: true
169 liveins: $sgpr0_sgpr1_sgpr2_sgpr3
171 ; GCN-LABEL: name: test_unmerge_values_s_s64_s_s64_s64_s_s192
172 ; GCN: liveins: $sgpr0_sgpr1_sgpr2_sgpr3
174 ; GCN-NEXT: [[DEF:%[0-9]+]]:sgpr_192 = IMPLICIT_DEF
175 ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY [[DEF]].sub0_sub1
176 ; GCN-NEXT: [[COPY1:%[0-9]+]]:sreg_64 = COPY [[DEF]].sub2_sub3
177 ; GCN-NEXT: [[COPY2:%[0-9]+]]:sreg_64 = COPY [[DEF]].sub4_sub5
178 ; GCN-NEXT: S_ENDPGM 0, implicit [[COPY]], implicit [[COPY1]], implicit [[COPY2]]
179 %0:sgpr(s192) = G_IMPLICIT_DEF
180 %1:sgpr(s64), %2:sgpr(s64), %3:sgpr(s64) = G_UNMERGE_VALUES %0
181 S_ENDPGM 0, implicit %1, implicit %2, implicit %3
185 name: test_unmerge_values_rc_set_def_v_s32_v_s32_v_s64
187 regBankSelected: true
188 tracksRegLiveness: true
192 liveins: $vgpr0_vgpr1
194 ; GCN-LABEL: name: test_unmerge_values_rc_set_def_v_s32_v_s32_v_s64
195 ; GCN: liveins: $vgpr0_vgpr1
197 ; GCN-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
198 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY [[COPY]].sub0
199 ; GCN-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY [[COPY]].sub1
200 ; GCN-NEXT: S_ENDPGM 0, implicit [[COPY1]], implicit [[COPY2]]
201 %0:vgpr(s64) = COPY $vgpr0_vgpr1
202 %1:vgpr_32(s32), %2:vgpr_32(s32) = G_UNMERGE_VALUES %0
203 S_ENDPGM 0, implicit %1, implicit %2
207 name: test_unmerge_values_rc_set_use_v_s32_v_s32_v_s64
209 regBankSelected: true
210 tracksRegLiveness: true
214 liveins: $vgpr0_vgpr1
216 ; GCN-LABEL: name: test_unmerge_values_rc_set_use_v_s32_v_s32_v_s64
217 ; GCN: liveins: $vgpr0_vgpr1
219 ; GCN-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
220 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY [[COPY]].sub0
221 ; GCN-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY [[COPY]].sub1
222 ; GCN-NEXT: S_ENDPGM 0, implicit [[COPY1]], implicit [[COPY2]]
223 %0:vreg_64(s64) = COPY $vgpr0_vgpr1
224 %1:vgpr(s32), %2:vgpr(s32) = G_UNMERGE_VALUES %0
225 S_ENDPGM 0, implicit %1, implicit %2
229 name: test_unmerge_values_s_s256_s_s1024
231 regBankSelected: true
232 tracksRegLiveness: true
236 liveins: $sgpr0_sgpr1_sgpr2_sgpr3
238 ; GCN-LABEL: name: test_unmerge_values_s_s256_s_s1024
239 ; GCN: liveins: $sgpr0_sgpr1_sgpr2_sgpr3
241 ; GCN-NEXT: [[DEF:%[0-9]+]]:sgpr_1024 = IMPLICIT_DEF
242 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr_256 = COPY [[DEF]].sub0_sub1_sub2_sub3_sub4_sub5_sub6_sub7
243 ; GCN-NEXT: [[COPY1:%[0-9]+]]:sgpr_256 = COPY [[DEF]].sub8_sub9_sub10_sub11_sub12_sub13_sub14_sub15
244 ; GCN-NEXT: [[COPY2:%[0-9]+]]:sgpr_256 = COPY [[DEF]].sub16_sub17_sub18_sub19_sub20_sub21_sub22_sub23
245 ; GCN-NEXT: [[COPY3:%[0-9]+]]:sgpr_256 = COPY [[DEF]].sub24_sub25_sub26_sub27_sub28_sub29_sub30_sub31
246 ; GCN-NEXT: S_ENDPGM 0, implicit [[COPY]], implicit [[COPY1]], implicit [[COPY2]], implicit [[COPY3]]
247 %0:sgpr(s1024) = G_IMPLICIT_DEF
248 %1:sgpr(s256), %2:sgpr(s256), %3:sgpr(s256), %4:sgpr(s256) = G_UNMERGE_VALUES %0
249 S_ENDPGM 0, implicit %1, implicit %2, implicit %3, implicit %4
254 name: test_unmerge_values_s_s512_s_s1024
256 regBankSelected: true
257 tracksRegLiveness: true
261 liveins: $sgpr0_sgpr1_sgpr2_sgpr3_sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11_sgpr12_sgpr13_sgpr14_sgpr15_sgpr16_sgpr17_sgpr18_sgpr19_sgpr20_sgpr21_sgpr22_sgpr23_sgpr24_sgpr25_sgpr26_sgpr27_sgpr28_sgpr29_sgpr30_sgpr31
263 ; GCN-LABEL: name: test_unmerge_values_s_s512_s_s1024
264 ; GCN: liveins: $sgpr0_sgpr1_sgpr2_sgpr3_sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11_sgpr12_sgpr13_sgpr14_sgpr15_sgpr16_sgpr17_sgpr18_sgpr19_sgpr20_sgpr21_sgpr22_sgpr23_sgpr24_sgpr25_sgpr26_sgpr27_sgpr28_sgpr29_sgpr30_sgpr31
266 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr_1024 = COPY $sgpr0_sgpr1_sgpr2_sgpr3_sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11_sgpr12_sgpr13_sgpr14_sgpr15_sgpr16_sgpr17_sgpr18_sgpr19_sgpr20_sgpr21_sgpr22_sgpr23_sgpr24_sgpr25_sgpr26_sgpr27_sgpr28_sgpr29_sgpr30_sgpr31
267 ; GCN-NEXT: [[COPY1:%[0-9]+]]:sgpr_512 = COPY [[COPY]].sub0_sub1_sub2_sub3_sub4_sub5_sub6_sub7_sub8_sub9_sub10_sub11_sub12_sub13_sub14_sub15
268 ; GCN-NEXT: [[COPY2:%[0-9]+]]:sgpr_512 = COPY [[COPY]].sub16_sub17_sub18_sub19_sub20_sub21_sub22_sub23_sub24_sub25_sub26_sub27_sub28_sub29_sub30_sub31
269 ; GCN-NEXT: $sgpr0_sgpr1_sgpr2_sgpr3_sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11_sgpr12_sgpr13_sgpr14_sgpr15 = COPY [[COPY1]]
270 ; GCN-NEXT: $sgpr16_sgpr17_sgpr18_sgpr19_sgpr20_sgpr21_sgpr22_sgpr23_sgpr24_sgpr25_sgpr26_sgpr27_sgpr28_sgpr29_sgpr30_sgpr31 = COPY [[COPY2]]
271 %0:sgpr(s1024) = COPY $sgpr0_sgpr1_sgpr2_sgpr3_sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11_sgpr12_sgpr13_sgpr14_sgpr15_sgpr16_sgpr17_sgpr18_sgpr19_sgpr20_sgpr21_sgpr22_sgpr23_sgpr24_sgpr25_sgpr26_sgpr27_sgpr28_sgpr29_sgpr30_sgpr31
272 %1:sgpr(s512), %2:sgpr(s512) = G_UNMERGE_VALUES %0
273 $sgpr0_sgpr1_sgpr2_sgpr3_sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11_sgpr12_sgpr13_sgpr14_sgpr15 = COPY %1
274 $sgpr16_sgpr17_sgpr18_sgpr19_sgpr20_sgpr21_sgpr22_sgpr23_sgpr24_sgpr25_sgpr26_sgpr27_sgpr28_sgpr29_sgpr30_sgpr31 = COPY %2
278 name: test_unmerge_s_v3s32_s_v12s32
280 regBankSelected: true
281 tracksRegLiveness: true
285 liveins: $sgpr0_sgpr1_sgpr2, $sgpr4_sgpr5_sgpr6, $sgpr8_sgpr9_sgpr10, $sgpr12_sgpr13_sgpr14
287 ; GCN-LABEL: name: test_unmerge_s_v3s32_s_v12s32
288 ; GCN: liveins: $sgpr0_sgpr1_sgpr2, $sgpr4_sgpr5_sgpr6, $sgpr8_sgpr9_sgpr10, $sgpr12_sgpr13_sgpr14
290 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(<3 x s32>) = COPY $sgpr0_sgpr1_sgpr2
291 ; GCN-NEXT: [[COPY1:%[0-9]+]]:sgpr(<3 x s32>) = COPY $sgpr4_sgpr5_sgpr6
292 ; GCN-NEXT: [[COPY2:%[0-9]+]]:sgpr(<3 x s32>) = COPY $sgpr8_sgpr9_sgpr10
293 ; GCN-NEXT: [[COPY3:%[0-9]+]]:sgpr(<3 x s32>) = COPY $sgpr12_sgpr13_sgpr14
294 ; GCN-NEXT: [[CONCAT_VECTORS:%[0-9]+]]:sgpr_384(<12 x s32>) = G_CONCAT_VECTORS [[COPY]](<3 x s32>), [[COPY1]](<3 x s32>), [[COPY2]](<3 x s32>), [[COPY3]](<3 x s32>)
295 ; GCN-NEXT: [[COPY4:%[0-9]+]]:sgpr_96(<3 x s32>) = COPY [[CONCAT_VECTORS]].sub0_sub1_sub2(<12 x s32>)
296 ; GCN-NEXT: [[COPY5:%[0-9]+]]:sgpr_96(<3 x s32>) = COPY [[CONCAT_VECTORS]].sub3_sub4_sub5(<12 x s32>)
297 ; GCN-NEXT: [[UV:%[0-9]+]]:sgpr_96(<3 x s32>), [[UV1:%[0-9]+]]:sgpr_96(<3 x s32>), [[UV2:%[0-9]+]]:sgpr_96(<3 x s32>), [[UV3:%[0-9]+]]:sgpr_96(<3 x s32>) = G_UNMERGE_VALUES [[CONCAT_VECTORS]](<12 x s32>)
298 ; GCN-NEXT: $sgpr0_sgpr1_sgpr2 = COPY [[UV]](<3 x s32>)
299 ; GCN-NEXT: $sgpr4_sgpr5_sgpr6 = COPY [[UV1]](<3 x s32>)
300 ; GCN-NEXT: $sgpr8_sgpr9_sgpr10 = COPY [[UV2]](<3 x s32>)
301 ; GCN-NEXT: $sgpr12_sgpr13_sgpr14 = COPY [[UV3]](<3 x s32>)
302 %0:sgpr(<3 x s32>) = COPY $sgpr0_sgpr1_sgpr2
303 %1:sgpr(<3 x s32>) = COPY $sgpr4_sgpr5_sgpr6
304 %2:sgpr(<3 x s32>) = COPY $sgpr8_sgpr9_sgpr10
305 %3:sgpr(<3 x s32>) = COPY $sgpr12_sgpr13_sgpr14
306 %4:sgpr(<12 x s32>) = G_CONCAT_VECTORS %0, %1, %2, %3
307 %5:sgpr(<3 x s32>), %6:sgpr(<3 x s32>), %7:sgpr(<3 x s32>), %8:sgpr(<3 x s32>) = G_UNMERGE_VALUES %4
308 $sgpr0_sgpr1_sgpr2 = COPY %5
309 $sgpr4_sgpr5_sgpr6 = COPY %6
310 $sgpr8_sgpr9_sgpr10 = COPY %7
311 $sgpr12_sgpr13_sgpr14 = COPY %8
316 name: test_unmerge_v_v3s32_v_v12s32
318 regBankSelected: true
319 tracksRegLiveness: true
322 liveins: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5, $vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11
324 ; GCN-LABEL: name: test_unmerge_v_v3s32_v_v12s32
325 ; GCN: liveins: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5, $vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11
327 ; GCN-NEXT: [[COPY:%[0-9]+]]:vreg_192 = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5
328 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vreg_192 = COPY $vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11
329 ; GCN-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_384 = REG_SEQUENCE [[COPY]], %subreg.sub0_sub1_sub2_sub3_sub4_sub5, [[COPY1]], %subreg.sub6_sub7_sub8_sub9_sub10_sub11
330 ; GCN-NEXT: [[COPY2:%[0-9]+]]:vreg_96 = COPY [[REG_SEQUENCE]].sub0_sub1_sub2
331 ; GCN-NEXT: [[COPY3:%[0-9]+]]:vreg_96 = COPY [[REG_SEQUENCE]].sub3_sub4_sub5
332 ; GCN-NEXT: [[COPY4:%[0-9]+]]:vreg_96 = COPY [[REG_SEQUENCE]].sub6_sub7_sub8
333 ; GCN-NEXT: [[COPY5:%[0-9]+]]:vreg_96 = COPY [[REG_SEQUENCE]].sub9_sub10_sub11
334 ; GCN-NEXT: $vgpr0_vgpr1_vgpr2 = COPY [[COPY2]]
335 ; GCN-NEXT: $vgpr3_vgpr4_vgpr5 = COPY [[COPY3]]
336 ; GCN-NEXT: $vgpr6_vgpr7_vgpr8 = COPY [[COPY4]]
337 ; GCN-NEXT: $vgpr9_vgpr10_vgpr11 = COPY [[COPY5]]
338 %0:vgpr(<6 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5
339 %1:vgpr(<6 x s32>) = COPY $vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11
340 %2:vgpr(<12 x s32>) = G_CONCAT_VECTORS %0, %1
341 %3:vgpr(<3 x s32>), %4:vgpr(<3 x s32>), %5:vgpr(<3 x s32>), %6:vgpr(<3 x s32>) = G_UNMERGE_VALUES %2
342 $vgpr0_vgpr1_vgpr2 = COPY %3
343 $vgpr3_vgpr4_vgpr5 = COPY %4
344 $vgpr6_vgpr7_vgpr8 = COPY %5
345 $vgpr9_vgpr10_vgpr11 = COPY %6