1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -amdgpu-global-isel-risky-select -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: successors: %bb.1(0x40000000), %bb.2(0x40000000)
14 ; GCN: liveins: $sgpr0, $sgpr1, $sgpr2
15 ; GCN: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
16 ; GCN: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
17 ; GCN: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr2
18 ; GCN: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
19 ; GCN: S_CMP_EQ_U32 [[COPY2]], [[S_MOV_B32_]], implicit-def $scc
20 ; GCN: [[COPY3:%[0-9]+]]:sreg_32 = COPY $scc
21 ; GCN: $scc = COPY [[COPY3]]
22 ; GCN: S_CBRANCH_SCC1 %bb.1, implicit $scc
25 ; GCN: successors: %bb.2(0x80000000)
28 ; GCN: [[PHI:%[0-9]+]]:sreg_32 = PHI [[COPY]], %bb.0, [[COPY1]], %bb.1
29 ; GCN: $sgpr0 = COPY [[PHI]]
30 ; GCN: S_SETPC_B64 undef $sgpr30_sgpr31
32 liveins: $sgpr0, $sgpr1, $sgpr2
34 %0:sgpr(s32) = COPY $sgpr0
35 %1:sgpr(s32) = COPY $sgpr1
36 %2:sgpr(s32) = COPY $sgpr2
37 %3:sgpr(s32) = G_CONSTANT i32 0
38 %4:sgpr(s32) = G_ICMP intpred(eq), %2(s32), %3
43 %5:sgpr(s32) = COPY %1
47 %6:sgpr(s32) = G_PHI %0(s32), %bb.0, %5(s32), %bb.1
49 S_SETPC_B64 undef $sgpr30_sgpr31
54 name: g_phi_s32_vv_sbranch
57 tracksRegLiveness: true
58 machineFunctionInfo: {}
60 ; GCN-LABEL: name: g_phi_s32_vv_sbranch
62 ; GCN: successors: %bb.1(0x40000000), %bb.2(0x40000000)
63 ; GCN: liveins: $vgpr0, $vgpr1, $sgpr2
64 ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
65 ; GCN: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
66 ; GCN: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr2
67 ; GCN: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
68 ; GCN: S_CMP_EQ_U32 [[COPY2]], [[S_MOV_B32_]], implicit-def $scc
69 ; GCN: [[COPY3:%[0-9]+]]:sreg_32 = COPY $scc
70 ; GCN: $scc = COPY [[COPY3]]
71 ; GCN: S_CBRANCH_SCC1 %bb.1, implicit $scc
74 ; GCN: successors: %bb.2(0x80000000)
75 ; GCN: [[COPY4:%[0-9]+]]:sreg_32 = COPY [[COPY1]]
78 ; GCN: [[PHI:%[0-9]+]]:vgpr_32 = PHI [[COPY]], %bb.0, [[COPY4]], %bb.1
79 ; GCN: $vgpr0 = COPY [[PHI]]
80 ; GCN: S_SETPC_B64 undef $sgpr30_sgpr31
82 liveins: $vgpr0, $vgpr1, $sgpr2
84 %0:vgpr(s32) = COPY $vgpr0
85 %1:vgpr(s32) = COPY $vgpr1
86 %2:sgpr(s32) = COPY $sgpr2
87 %3:sgpr(s32) = G_CONSTANT i32 0
88 %4:sgpr(s32) = G_ICMP intpred(eq), %2(s32), %3
93 %5:sgpr(s32) = COPY %1
97 %6:vgpr(s32) = G_PHI %0(s32), %bb.0, %5(s32), %bb.1
99 S_SETPC_B64 undef $sgpr30_sgpr31
104 name: g_phi_s32_sv_sbranch
106 regBankSelected: true
107 tracksRegLiveness: true
108 machineFunctionInfo: {}
110 ; GCN-LABEL: name: g_phi_s32_sv_sbranch
112 ; GCN: successors: %bb.1(0x40000000), %bb.2(0x40000000)
113 ; GCN: liveins: $sgpr0, $vgpr0, $sgpr1, $sgpr2
114 ; GCN: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
115 ; GCN: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr0
116 ; GCN: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr2
117 ; GCN: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
118 ; GCN: S_CMP_EQ_U32 [[COPY2]], [[S_MOV_B32_]], implicit-def $scc
119 ; GCN: [[COPY3:%[0-9]+]]:sreg_32 = COPY $scc
120 ; GCN: $scc = COPY [[COPY3]]
121 ; GCN: S_CBRANCH_SCC1 %bb.1, implicit $scc
122 ; GCN: S_BRANCH %bb.2
124 ; GCN: successors: %bb.2(0x80000000)
125 ; GCN: S_BRANCH %bb.2
127 ; GCN: [[PHI:%[0-9]+]]:vgpr_32 = PHI [[COPY]], %bb.0, [[COPY1]], %bb.1
128 ; GCN: $vgpr0 = COPY [[PHI]]
129 ; GCN: S_SETPC_B64 undef $sgpr30_sgpr31
131 liveins: $sgpr0, $vgpr0, $sgpr1, $sgpr2
133 %0:sgpr(s32) = COPY $sgpr0
134 %1:vgpr(s32) = COPY $vgpr0
135 %2:sgpr(s32) = COPY $sgpr2
136 %3:sgpr(s32) = G_CONSTANT i32 0
137 %4:sgpr(s32) = G_ICMP intpred(eq), %2(s32), %3
142 %5:vgpr(s32) = COPY %1
146 %6:vgpr(s32) = G_PHI %0(s32), %bb.0, %5(s32), %bb.1
148 S_SETPC_B64 undef $sgpr30_sgpr31
153 name: g_phi_s32_vs_sbranch
155 regBankSelected: true
156 tracksRegLiveness: true
157 machineFunctionInfo: {}
159 ; GCN-LABEL: name: g_phi_s32_vs_sbranch
161 ; GCN: successors: %bb.1(0x40000000), %bb.2(0x40000000)
162 ; GCN: liveins: $sgpr0, $vgpr0, $sgpr1
163 ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
164 ; GCN: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr0
165 ; GCN: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr1
166 ; GCN: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
167 ; GCN: S_CMP_EQ_U32 [[COPY2]], [[S_MOV_B32_]], implicit-def $scc
168 ; GCN: [[COPY3:%[0-9]+]]:sreg_32 = COPY $scc
169 ; GCN: $scc = COPY [[COPY3]]
170 ; GCN: S_CBRANCH_SCC1 %bb.1, implicit $scc
171 ; GCN: S_BRANCH %bb.2
173 ; GCN: successors: %bb.2(0x80000000)
174 ; GCN: [[COPY4:%[0-9]+]]:vgpr_32 = COPY [[COPY1]]
175 ; GCN: S_BRANCH %bb.2
177 ; GCN: [[PHI:%[0-9]+]]:vgpr_32 = PHI [[COPY]], %bb.0, [[COPY4]], %bb.1
178 ; GCN: $vgpr0 = COPY [[PHI]]
179 ; GCN: S_SETPC_B64 undef $sgpr30_sgpr31
181 liveins: $sgpr0, $vgpr0, $sgpr1
183 %0:vgpr(s32) = COPY $vgpr0
184 %1:sgpr(s32) = COPY $sgpr0
185 %2:sgpr(s32) = COPY $sgpr1
186 %3:sgpr(s32) = G_CONSTANT i32 0
187 %4:sgpr(s32) = G_ICMP intpred(eq), %2(s32), %3
192 %5:vgpr(s32) = COPY %1
196 %6:vgpr(s32) = G_PHI %0(s32), %bb.0, %5(s32), %bb.1
198 S_SETPC_B64 undef $sgpr30_sgpr31
203 name: g_phi_s64_ss_sbranch
205 regBankSelected: true
206 tracksRegLiveness: true
207 machineFunctionInfo: {}
209 ; GCN-LABEL: name: g_phi_s64_ss_sbranch
211 ; GCN: successors: %bb.1(0x40000000), %bb.2(0x40000000)
212 ; GCN: liveins: $sgpr0_sgpr1, $sgpr2_sgpr3, $sgpr4
213 ; GCN: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
214 ; GCN: [[COPY1:%[0-9]+]]:sreg_64 = COPY $sgpr2_sgpr3
215 ; GCN: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr4
216 ; GCN: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
217 ; GCN: S_CMP_EQ_U32 [[COPY2]], [[S_MOV_B32_]], implicit-def $scc
218 ; GCN: [[COPY3:%[0-9]+]]:sreg_32 = COPY $scc
219 ; GCN: $scc = COPY [[COPY3]]
220 ; GCN: S_CBRANCH_SCC1 %bb.1, implicit $scc
221 ; GCN: S_BRANCH %bb.2
223 ; GCN: successors: %bb.2(0x80000000)
224 ; GCN: S_BRANCH %bb.2
226 ; GCN: [[PHI:%[0-9]+]]:sreg_64 = PHI [[COPY]], %bb.0, [[COPY1]], %bb.1
227 ; GCN: $sgpr0_sgpr1 = COPY [[PHI]]
228 ; GCN: S_SETPC_B64 undef $sgpr30_sgpr31
230 liveins: $sgpr0_sgpr1, $sgpr2_sgpr3, $sgpr4
232 %0:sgpr(s64) = COPY $sgpr0_sgpr1
233 %1:sgpr(s64) = COPY $sgpr2_sgpr3
234 %2:sgpr(s32) = COPY $sgpr4
235 %3:sgpr(s32) = G_CONSTANT i32 0
236 %4:sgpr(s32) = G_ICMP intpred(eq), %2(s32), %3
241 %5:sgpr(s64) = COPY %1
245 %6:sgpr(s64) = G_PHI %0(s64), %bb.0, %5(s64), %bb.1
246 $sgpr0_sgpr1 = COPY %6
247 S_SETPC_B64 undef $sgpr30_sgpr31
251 name: g_phi_v2s16_vv_sbranch
253 regBankSelected: true
254 tracksRegLiveness: true
255 machineFunctionInfo: {}
257 ; GCN-LABEL: name: g_phi_v2s16_vv_sbranch
259 ; GCN: successors: %bb.1(0x40000000), %bb.2(0x40000000)
260 ; GCN: liveins: $vgpr0, $vgpr1, $sgpr2
261 ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
262 ; GCN: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
263 ; GCN: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr2
264 ; GCN: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
265 ; GCN: S_CMP_EQ_U32 [[COPY2]], [[S_MOV_B32_]], implicit-def $scc
266 ; GCN: [[COPY3:%[0-9]+]]:sreg_32 = COPY $scc
267 ; GCN: $scc = COPY [[COPY3]]
268 ; GCN: S_CBRANCH_SCC1 %bb.1, implicit $scc
269 ; GCN: S_BRANCH %bb.2
271 ; GCN: successors: %bb.2(0x80000000)
272 ; GCN: [[COPY4:%[0-9]+]]:sreg_32 = COPY [[COPY1]]
273 ; GCN: S_BRANCH %bb.2
275 ; GCN: [[PHI:%[0-9]+]]:vgpr_32 = PHI [[COPY]], %bb.0, [[COPY4]], %bb.1
276 ; GCN: $vgpr0 = COPY [[PHI]]
277 ; GCN: S_SETPC_B64 undef $sgpr30_sgpr31
279 liveins: $vgpr0, $vgpr1, $sgpr2
281 %0:vgpr(<2 x s16>) = COPY $vgpr0
282 %1:vgpr(<2 x s16>) = COPY $vgpr1
283 %2:sgpr(s32) = COPY $sgpr2
284 %3:sgpr(s32) = G_CONSTANT i32 0
285 %4:sgpr(s32) = G_ICMP intpred(eq), %2(s32), %3
290 %5:sgpr(<2 x s16>) = COPY %1
294 %6:vgpr(<2 x s16>) = G_PHI %0(<2 x s16>), %bb.0, %5(<2 x s16>), %bb.1
296 S_SETPC_B64 undef $sgpr30_sgpr31
301 name: g_phi_vcc_s1_sbranch
303 regBankSelected: true
304 tracksRegLiveness: true
305 machineFunctionInfo: {}
307 ; GCN-LABEL: name: g_phi_vcc_s1_sbranch
309 ; GCN: successors: %bb.1(0x40000000), %bb.2(0x40000000)
310 ; GCN: liveins: $vgpr0, $vgpr1, $sgpr2
311 ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
312 ; GCN: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
313 ; GCN: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr2
314 ; GCN: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
315 ; GCN: [[V_CMP_EQ_U32_e64_:%[0-9]+]]:sreg_64 = V_CMP_EQ_U32_e64 [[COPY]], [[S_MOV_B32_]], implicit $exec
316 ; GCN: S_CMP_EQ_U32 [[COPY2]], [[S_MOV_B32_]], implicit-def $scc
317 ; GCN: [[COPY3:%[0-9]+]]:sreg_32 = COPY $scc
318 ; GCN: $scc = COPY [[COPY3]]
319 ; GCN: S_CBRANCH_SCC1 %bb.1, implicit $scc
320 ; GCN: S_BRANCH %bb.2
322 ; GCN: successors: %bb.2(0x80000000)
323 ; GCN: [[V_CMP_EQ_U32_e64_1:%[0-9]+]]:sreg_64 = V_CMP_EQ_U32_e64 [[COPY1]], [[S_MOV_B32_]], implicit $exec
324 ; GCN: S_BRANCH %bb.2
326 ; GCN: [[PHI:%[0-9]+]]:sreg_64_xexec = PHI [[V_CMP_EQ_U32_e64_]], %bb.0, [[V_CMP_EQ_U32_e64_1]], %bb.1
327 ; GCN: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[PHI]]
329 liveins: $vgpr0, $vgpr1, $sgpr2
331 %0:vgpr(s32) = COPY $vgpr0
332 %1:vgpr(s32) = COPY $vgpr1
333 %2:sgpr(s32) = COPY $sgpr2
334 %3:sgpr(s32) = G_CONSTANT i32 0
335 %4:vcc(s1) = G_ICMP intpred(eq), %0, %3
336 %5:sgpr(s32) = G_ICMP intpred(eq), %2(s32), %3
341 %6:vcc(s1) = G_ICMP intpred(eq), %1, %3
345 %7:vcc(s1) = G_PHI %4, %bb.0, %6, %bb.1
346 S_SETPC_B64 undef $sgpr30_sgpr31, implicit %7
351 name: phi_s32_ss_sbranch
353 regBankSelected: true
354 tracksRegLiveness: true
355 machineFunctionInfo: {}
357 ; GCN-LABEL: name: phi_s32_ss_sbranch
359 ; GCN: successors: %bb.1(0x40000000), %bb.2(0x40000000)
360 ; GCN: liveins: $sgpr0, $sgpr1, $sgpr2
361 ; GCN: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
362 ; GCN: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
363 ; GCN: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr2
364 ; GCN: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
365 ; GCN: S_CMP_EQ_U32 [[COPY2]], [[S_MOV_B32_]], implicit-def $scc
366 ; GCN: [[COPY3:%[0-9]+]]:sreg_32 = COPY $scc
367 ; GCN: $scc = COPY [[COPY3]]
368 ; GCN: S_CBRANCH_SCC1 %bb.1, implicit $scc
369 ; GCN: S_BRANCH %bb.2
371 ; GCN: successors: %bb.2(0x80000000)
372 ; GCN: S_BRANCH %bb.2
374 ; GCN: [[PHI:%[0-9]+]]:sreg_32 = PHI [[COPY]], %bb.0, [[COPY1]], %bb.1
375 ; GCN: $sgpr0 = COPY [[PHI]]
376 ; GCN: S_SETPC_B64 undef $sgpr30_sgpr31
378 liveins: $sgpr0, $sgpr1, $sgpr2
380 %0:sgpr(s32) = COPY $sgpr0
381 %1:sgpr(s32) = COPY $sgpr1
382 %2:sgpr(s32) = COPY $sgpr2
383 %3:sgpr(s32) = G_CONSTANT i32 0
384 %4:sgpr(s32) = G_ICMP intpred(eq), %2(s32), %3
389 %5:sgpr(s32) = COPY %1
393 %6:sgpr(s32) = PHI %0(s32), %bb.0, %5(s32), %bb.1
394 $sgpr0 = COPY %6(s32)
395 S_SETPC_B64 undef $sgpr30_sgpr31
400 name: phi_s32_vv_sbranch
402 regBankSelected: true
403 tracksRegLiveness: true
404 machineFunctionInfo: {}
406 ; GCN-LABEL: name: phi_s32_vv_sbranch
408 ; GCN: successors: %bb.1(0x40000000), %bb.2(0x40000000)
409 ; GCN: liveins: $vgpr0, $vgpr1, $sgpr2
410 ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
411 ; GCN: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
412 ; GCN: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr2
413 ; GCN: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
414 ; GCN: S_CMP_EQ_U32 [[COPY2]], [[S_MOV_B32_]], implicit-def $scc
415 ; GCN: [[COPY3:%[0-9]+]]:sreg_32 = COPY $scc
416 ; GCN: $scc = COPY [[COPY3]]
417 ; GCN: S_CBRANCH_SCC1 %bb.1, implicit $scc
418 ; GCN: S_BRANCH %bb.2
420 ; GCN: successors: %bb.2(0x80000000)
421 ; GCN: [[COPY4:%[0-9]+]]:sreg_32 = COPY [[COPY1]]
422 ; GCN: S_BRANCH %bb.2
424 ; GCN: [[PHI:%[0-9]+]]:vgpr_32 = PHI [[COPY]], %bb.0, [[COPY4]], %bb.1
425 ; GCN: $vgpr0 = COPY [[PHI]]
426 ; GCN: S_SETPC_B64 undef $sgpr30_sgpr31
428 liveins: $vgpr0, $vgpr1, $sgpr2
430 %0:vgpr(s32) = COPY $vgpr0
431 %1:vgpr(s32) = COPY $vgpr1
432 %2:sgpr(s32) = COPY $sgpr2
433 %3:sgpr(s32) = G_CONSTANT i32 0
434 %4:sgpr(s32) = G_ICMP intpred(eq), %2(s32), %3
439 %5:sgpr(s32) = COPY %1
443 %6:vgpr(s32) = PHI %0(s32), %bb.0, %5(s32), %bb.1
445 S_SETPC_B64 undef $sgpr30_sgpr31