1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s -check-prefix=GCN
5 name: g_phi_s32_ss_sbranch
8 tracksRegLiveness: true
9 machineFunctionInfo: {}
11 ; GCN-LABEL: name: g_phi_s32_ss_sbranch
13 ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
14 ; GCN-NEXT: liveins: $sgpr0, $sgpr1, $sgpr2
16 ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
17 ; GCN-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
18 ; GCN-NEXT: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr2
19 ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
20 ; GCN-NEXT: S_CMP_EQ_U32 [[COPY2]], [[S_MOV_B32_]], implicit-def $scc
21 ; GCN-NEXT: [[COPY3:%[0-9]+]]:sreg_32 = COPY $scc
22 ; GCN-NEXT: $scc = COPY [[COPY3]]
23 ; GCN-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc
24 ; GCN-NEXT: S_BRANCH %bb.2
27 ; GCN-NEXT: successors: %bb.2(0x80000000)
29 ; GCN-NEXT: S_BRANCH %bb.2
32 ; GCN-NEXT: [[PHI:%[0-9]+]]:sreg_32 = PHI [[COPY]], %bb.0, [[COPY1]], %bb.1
33 ; GCN-NEXT: $sgpr0 = COPY [[PHI]]
34 ; GCN-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
36 liveins: $sgpr0, $sgpr1, $sgpr2
38 %0:sgpr(s32) = COPY $sgpr0
39 %1:sgpr(s32) = COPY $sgpr1
40 %2:sgpr(s32) = COPY $sgpr2
41 %3:sgpr(s32) = G_CONSTANT i32 0
42 %4:sgpr(s32) = G_ICMP intpred(eq), %2(s32), %3
47 %5:sgpr(s32) = COPY %1
51 %6:sgpr(s32) = G_PHI %0(s32), %bb.0, %5(s32), %bb.1
53 S_SETPC_B64 undef $sgpr30_sgpr31
58 name: g_phi_s32_vv_sbranch
61 tracksRegLiveness: true
62 machineFunctionInfo: {}
64 ; GCN-LABEL: name: g_phi_s32_vv_sbranch
66 ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
67 ; GCN-NEXT: liveins: $vgpr0, $vgpr1, $sgpr2
69 ; GCN-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
70 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
71 ; GCN-NEXT: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr2
72 ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
73 ; GCN-NEXT: S_CMP_EQ_U32 [[COPY2]], [[S_MOV_B32_]], implicit-def $scc
74 ; GCN-NEXT: [[COPY3:%[0-9]+]]:sreg_32 = COPY $scc
75 ; GCN-NEXT: $scc = COPY [[COPY3]]
76 ; GCN-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc
77 ; GCN-NEXT: S_BRANCH %bb.2
80 ; GCN-NEXT: successors: %bb.2(0x80000000)
82 ; GCN-NEXT: [[COPY4:%[0-9]+]]:sreg_32 = COPY [[COPY1]]
83 ; GCN-NEXT: S_BRANCH %bb.2
86 ; GCN-NEXT: [[PHI:%[0-9]+]]:vgpr_32 = PHI [[COPY]], %bb.0, [[COPY4]], %bb.1
87 ; GCN-NEXT: $vgpr0 = COPY [[PHI]]
88 ; GCN-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
90 liveins: $vgpr0, $vgpr1, $sgpr2
92 %0:vgpr(s32) = COPY $vgpr0
93 %1:vgpr(s32) = COPY $vgpr1
94 %2:sgpr(s32) = COPY $sgpr2
95 %3:sgpr(s32) = G_CONSTANT i32 0
96 %4:sgpr(s32) = G_ICMP intpred(eq), %2(s32), %3
101 %5:sgpr(s32) = COPY %1
105 %6:vgpr(s32) = G_PHI %0(s32), %bb.0, %5(s32), %bb.1
106 $vgpr0 = COPY %6(s32)
107 S_SETPC_B64 undef $sgpr30_sgpr31
112 name: g_phi_s32_sv_sbranch
114 regBankSelected: true
115 tracksRegLiveness: true
116 machineFunctionInfo: {}
118 ; GCN-LABEL: name: g_phi_s32_sv_sbranch
120 ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
121 ; GCN-NEXT: liveins: $sgpr0, $vgpr0, $sgpr1, $sgpr2
123 ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
124 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr0
125 ; GCN-NEXT: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr2
126 ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
127 ; GCN-NEXT: S_CMP_EQ_U32 [[COPY2]], [[S_MOV_B32_]], implicit-def $scc
128 ; GCN-NEXT: [[COPY3:%[0-9]+]]:sreg_32 = COPY $scc
129 ; GCN-NEXT: $scc = COPY [[COPY3]]
130 ; GCN-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc
131 ; GCN-NEXT: S_BRANCH %bb.2
134 ; GCN-NEXT: successors: %bb.2(0x80000000)
136 ; GCN-NEXT: S_BRANCH %bb.2
139 ; GCN-NEXT: [[PHI:%[0-9]+]]:vgpr_32 = PHI [[COPY]], %bb.0, [[COPY1]], %bb.1
140 ; GCN-NEXT: $vgpr0 = COPY [[PHI]]
141 ; GCN-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
143 liveins: $sgpr0, $vgpr0, $sgpr1, $sgpr2
145 %0:sgpr(s32) = COPY $sgpr0
146 %1:vgpr(s32) = COPY $vgpr0
147 %2:sgpr(s32) = COPY $sgpr2
148 %3:sgpr(s32) = G_CONSTANT i32 0
149 %4:sgpr(s32) = G_ICMP intpred(eq), %2(s32), %3
154 %5:vgpr(s32) = COPY %1
158 %6:vgpr(s32) = G_PHI %0(s32), %bb.0, %5(s32), %bb.1
160 S_SETPC_B64 undef $sgpr30_sgpr31
165 name: g_phi_s32_vs_sbranch
167 regBankSelected: true
168 tracksRegLiveness: true
169 machineFunctionInfo: {}
171 ; GCN-LABEL: name: g_phi_s32_vs_sbranch
173 ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
174 ; GCN-NEXT: liveins: $sgpr0, $vgpr0, $sgpr1
176 ; GCN-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
177 ; GCN-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr0
178 ; GCN-NEXT: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr1
179 ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
180 ; GCN-NEXT: S_CMP_EQ_U32 [[COPY2]], [[S_MOV_B32_]], implicit-def $scc
181 ; GCN-NEXT: [[COPY3:%[0-9]+]]:sreg_32 = COPY $scc
182 ; GCN-NEXT: $scc = COPY [[COPY3]]
183 ; GCN-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc
184 ; GCN-NEXT: S_BRANCH %bb.2
187 ; GCN-NEXT: successors: %bb.2(0x80000000)
189 ; GCN-NEXT: [[COPY4:%[0-9]+]]:vgpr_32 = COPY [[COPY1]]
190 ; GCN-NEXT: S_BRANCH %bb.2
193 ; GCN-NEXT: [[PHI:%[0-9]+]]:vgpr_32 = PHI [[COPY]], %bb.0, [[COPY4]], %bb.1
194 ; GCN-NEXT: $vgpr0 = COPY [[PHI]]
195 ; GCN-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
197 liveins: $sgpr0, $vgpr0, $sgpr1
199 %0:vgpr(s32) = COPY $vgpr0
200 %1:sgpr(s32) = COPY $sgpr0
201 %2:sgpr(s32) = COPY $sgpr1
202 %3:sgpr(s32) = G_CONSTANT i32 0
203 %4:sgpr(s32) = G_ICMP intpred(eq), %2(s32), %3
208 %5:vgpr(s32) = COPY %1
212 %6:vgpr(s32) = G_PHI %0(s32), %bb.0, %5(s32), %bb.1
214 S_SETPC_B64 undef $sgpr30_sgpr31
219 name: g_phi_s64_ss_sbranch
221 regBankSelected: true
222 tracksRegLiveness: true
223 machineFunctionInfo: {}
225 ; GCN-LABEL: name: g_phi_s64_ss_sbranch
227 ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
228 ; GCN-NEXT: liveins: $sgpr0_sgpr1, $sgpr2_sgpr3, $sgpr4
230 ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
231 ; GCN-NEXT: [[COPY1:%[0-9]+]]:sreg_64 = COPY $sgpr2_sgpr3
232 ; GCN-NEXT: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr4
233 ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
234 ; GCN-NEXT: S_CMP_EQ_U32 [[COPY2]], [[S_MOV_B32_]], implicit-def $scc
235 ; GCN-NEXT: [[COPY3:%[0-9]+]]:sreg_32 = COPY $scc
236 ; GCN-NEXT: $scc = COPY [[COPY3]]
237 ; GCN-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc
238 ; GCN-NEXT: S_BRANCH %bb.2
241 ; GCN-NEXT: successors: %bb.2(0x80000000)
243 ; GCN-NEXT: S_BRANCH %bb.2
246 ; GCN-NEXT: [[PHI:%[0-9]+]]:sreg_64 = PHI [[COPY]], %bb.0, [[COPY1]], %bb.1
247 ; GCN-NEXT: $sgpr0_sgpr1 = COPY [[PHI]]
248 ; GCN-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
250 liveins: $sgpr0_sgpr1, $sgpr2_sgpr3, $sgpr4
252 %0:sgpr(s64) = COPY $sgpr0_sgpr1
253 %1:sgpr(s64) = COPY $sgpr2_sgpr3
254 %2:sgpr(s32) = COPY $sgpr4
255 %3:sgpr(s32) = G_CONSTANT i32 0
256 %4:sgpr(s32) = G_ICMP intpred(eq), %2(s32), %3
261 %5:sgpr(s64) = COPY %1
265 %6:sgpr(s64) = G_PHI %0(s64), %bb.0, %5(s64), %bb.1
266 $sgpr0_sgpr1 = COPY %6
267 S_SETPC_B64 undef $sgpr30_sgpr31
271 name: g_phi_v2s16_vv_sbranch
273 regBankSelected: true
274 tracksRegLiveness: true
275 machineFunctionInfo: {}
277 ; GCN-LABEL: name: g_phi_v2s16_vv_sbranch
279 ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
280 ; GCN-NEXT: liveins: $vgpr0, $vgpr1, $sgpr2
282 ; GCN-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
283 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
284 ; GCN-NEXT: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr2
285 ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
286 ; GCN-NEXT: S_CMP_EQ_U32 [[COPY2]], [[S_MOV_B32_]], implicit-def $scc
287 ; GCN-NEXT: [[COPY3:%[0-9]+]]:sreg_32 = COPY $scc
288 ; GCN-NEXT: $scc = COPY [[COPY3]]
289 ; GCN-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc
290 ; GCN-NEXT: S_BRANCH %bb.2
293 ; GCN-NEXT: successors: %bb.2(0x80000000)
295 ; GCN-NEXT: [[COPY4:%[0-9]+]]:sreg_32 = COPY [[COPY1]]
296 ; GCN-NEXT: S_BRANCH %bb.2
299 ; GCN-NEXT: [[PHI:%[0-9]+]]:vgpr_32 = PHI [[COPY]], %bb.0, [[COPY4]], %bb.1
300 ; GCN-NEXT: $vgpr0 = COPY [[PHI]]
301 ; GCN-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
303 liveins: $vgpr0, $vgpr1, $sgpr2
305 %0:vgpr(<2 x s16>) = COPY $vgpr0
306 %1:vgpr(<2 x s16>) = COPY $vgpr1
307 %2:sgpr(s32) = COPY $sgpr2
308 %3:sgpr(s32) = G_CONSTANT i32 0
309 %4:sgpr(s32) = G_ICMP intpred(eq), %2(s32), %3
314 %5:sgpr(<2 x s16>) = COPY %1
318 %6:vgpr(<2 x s16>) = G_PHI %0(<2 x s16>), %bb.0, %5(<2 x s16>), %bb.1
320 S_SETPC_B64 undef $sgpr30_sgpr31
325 name: phi_s32_ss_sbranch
327 regBankSelected: true
328 tracksRegLiveness: true
329 machineFunctionInfo: {}
331 ; GCN-LABEL: name: phi_s32_ss_sbranch
333 ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
334 ; GCN-NEXT: liveins: $sgpr0, $sgpr1, $sgpr2
336 ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
337 ; GCN-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
338 ; GCN-NEXT: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr2
339 ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
340 ; GCN-NEXT: S_CMP_EQ_U32 [[COPY2]], [[S_MOV_B32_]], implicit-def $scc
341 ; GCN-NEXT: [[COPY3:%[0-9]+]]:sreg_32 = COPY $scc
342 ; GCN-NEXT: $scc = COPY [[COPY3]]
343 ; GCN-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc
344 ; GCN-NEXT: S_BRANCH %bb.2
347 ; GCN-NEXT: successors: %bb.2(0x80000000)
349 ; GCN-NEXT: S_BRANCH %bb.2
352 ; GCN-NEXT: [[PHI:%[0-9]+]]:sreg_32 = PHI [[COPY]], %bb.0, [[COPY1]], %bb.1
353 ; GCN-NEXT: $sgpr0 = COPY [[PHI]]
354 ; GCN-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
356 liveins: $sgpr0, $sgpr1, $sgpr2
358 %0:sgpr(s32) = COPY $sgpr0
359 %1:sgpr(s32) = COPY $sgpr1
360 %2:sgpr(s32) = COPY $sgpr2
361 %3:sgpr(s32) = G_CONSTANT i32 0
362 %4:sgpr(s32) = G_ICMP intpred(eq), %2(s32), %3
367 %5:sgpr(s32) = COPY %1
371 %6:sgpr(s32) = G_PHI %0(s32), %bb.0, %5(s32), %bb.1
372 $sgpr0 = COPY %6(s32)
373 S_SETPC_B64 undef $sgpr30_sgpr31
378 name: phi_s32_vv_sbranch
380 regBankSelected: true
381 tracksRegLiveness: true
382 machineFunctionInfo: {}
384 ; GCN-LABEL: name: phi_s32_vv_sbranch
386 ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
387 ; GCN-NEXT: liveins: $vgpr0, $vgpr1, $sgpr2
389 ; GCN-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
390 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
391 ; GCN-NEXT: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr2
392 ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
393 ; GCN-NEXT: S_CMP_EQ_U32 [[COPY2]], [[S_MOV_B32_]], implicit-def $scc
394 ; GCN-NEXT: [[COPY3:%[0-9]+]]:sreg_32 = COPY $scc
395 ; GCN-NEXT: $scc = COPY [[COPY3]]
396 ; GCN-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc
397 ; GCN-NEXT: S_BRANCH %bb.2
400 ; GCN-NEXT: successors: %bb.2(0x80000000)
402 ; GCN-NEXT: [[COPY4:%[0-9]+]]:sreg_32 = COPY [[COPY1]]
403 ; GCN-NEXT: S_BRANCH %bb.2
406 ; GCN-NEXT: [[PHI:%[0-9]+]]:vgpr_32 = PHI [[COPY]], %bb.0, [[COPY4]], %bb.1
407 ; GCN-NEXT: $vgpr0 = COPY [[PHI]]
408 ; GCN-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
410 liveins: $vgpr0, $vgpr1, $sgpr2
412 %0:vgpr(s32) = COPY $vgpr0
413 %1:vgpr(s32) = COPY $vgpr1
414 %2:sgpr(s32) = COPY $sgpr2
415 %3:sgpr(s32) = G_CONSTANT i32 0
416 %4:sgpr(s32) = G_ICMP intpred(eq), %2(s32), %3
421 %5:sgpr(s32) = COPY %1
425 %6:vgpr(s32) = G_PHI %0(s32), %bb.0, %5(s32), %bb.1
427 S_SETPC_B64 undef $sgpr30_sgpr31