1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -verify-machineinstrs -run-pass si-fold-operands,dead-mi-elimination %s -o - | FileCheck -check-prefix=GCN %s
6 name: shrink_scalar_imm_vgpr_v_add_i32_e64_no_carry_out_use
7 tracksRegLiveness: true
11 ; GCN-LABEL: name: shrink_scalar_imm_vgpr_v_add_i32_e64_no_carry_out_use
12 ; GCN: [[S_MOV_B32_:%[0-9]+]]:sreg_32_xm0 = S_MOV_B32 12345
13 ; GCN-NEXT: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
14 ; GCN-NEXT: [[V_ADD_CO_U32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_CO_U32_e32 [[S_MOV_B32_]], [[DEF]], implicit-def $vcc, implicit $exec
15 ; GCN-NEXT: S_ENDPGM 0, implicit [[V_ADD_CO_U32_e32_]]
16 %0:sreg_32_xm0 = S_MOV_B32 12345
17 %1:vgpr_32 = IMPLICIT_DEF
18 %2:vgpr_32, %3:sreg_64 = V_ADD_CO_U32_e64 %0, %1, 0, implicit $exec
19 S_ENDPGM 0, implicit %2
25 name: shrink_vgpr_scalar_imm_v_add_i32_e64_no_carry_out_use
26 tracksRegLiveness: true
30 ; GCN-LABEL: name: shrink_vgpr_scalar_imm_v_add_i32_e64_no_carry_out_use
31 ; GCN: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
32 ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32_xm0 = S_MOV_B32 12345
33 ; GCN-NEXT: [[V_ADD_CO_U32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_CO_U32_e32 [[S_MOV_B32_]], [[DEF]], implicit-def $vcc, implicit $exec
34 ; GCN-NEXT: S_ENDPGM 0, implicit [[V_ADD_CO_U32_e32_]]
35 %0:vgpr_32 = IMPLICIT_DEF
36 %1:sreg_32_xm0 = S_MOV_B32 12345
37 %2:vgpr_32, %3:sreg_64 = V_ADD_CO_U32_e64 %0, %1, 0, implicit $exec
38 S_ENDPGM 0, implicit %2
43 name: shrink_scalar_imm_vgpr_v_add_i32_e64_carry_out_use
44 tracksRegLiveness: true
48 ; GCN-LABEL: name: shrink_scalar_imm_vgpr_v_add_i32_e64_carry_out_use
49 ; GCN: [[S_MOV_B32_:%[0-9]+]]:sreg_32_xm0 = S_MOV_B32 12345
50 ; GCN-NEXT: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
51 ; GCN-NEXT: [[V_ADD_CO_U32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_CO_U32_e32 [[S_MOV_B32_]], [[DEF]], implicit-def $vcc, implicit $exec
52 ; GCN-NEXT: S_ENDPGM 0, implicit [[V_ADD_CO_U32_e32_]]
53 %0:sreg_32_xm0 = S_MOV_B32 12345
54 %1:vgpr_32 = IMPLICIT_DEF
55 %2:vgpr_32, %3:sreg_64 = V_ADD_CO_U32_e64 %0, %1, 0, implicit $exec
56 S_ENDPGM 0, implicit %2
61 # This does not shrink because it would violate the constant bus
62 # restriction. to have an SGPR input and an immediate, so a copy would
65 name: shrink_vector_imm_sgpr_v_add_i32_e64_no_carry_out_use
66 tracksRegLiveness: true
70 ; GCN-LABEL: name: shrink_vector_imm_sgpr_v_add_i32_e64_no_carry_out_use
71 ; GCN: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 12345, implicit $exec
72 ; GCN-NEXT: [[DEF:%[0-9]+]]:sreg_32_xm0 = IMPLICIT_DEF
73 ; GCN-NEXT: [[V_ADD_CO_U32_e64_:%[0-9]+]]:vgpr_32, [[V_ADD_CO_U32_e64_1:%[0-9]+]]:sreg_64 = V_ADD_CO_U32_e64 [[DEF]], [[V_MOV_B32_e32_]], 0, implicit $exec
74 ; GCN-NEXT: S_ENDPGM 0, implicit [[V_ADD_CO_U32_e64_]]
75 %0:vgpr_32 = V_MOV_B32_e32 12345, implicit $exec
76 %1:sreg_32_xm0 = IMPLICIT_DEF
77 %2:vgpr_32, %3:sreg_64 = V_ADD_CO_U32_e64 %0, %1, 0, implicit $exec
78 S_ENDPGM 0, implicit %2
84 name: shrink_sgpr_vector_imm_v_add_i32_e64_no_carry_out_use
85 tracksRegLiveness: true
89 ; GCN-LABEL: name: shrink_sgpr_vector_imm_v_add_i32_e64_no_carry_out_use
90 ; GCN: [[DEF:%[0-9]+]]:sreg_32_xm0 = IMPLICIT_DEF
91 ; GCN-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 12345, implicit $exec
92 ; GCN-NEXT: [[V_ADD_CO_U32_e64_:%[0-9]+]]:vgpr_32, [[V_ADD_CO_U32_e64_1:%[0-9]+]]:sreg_64 = V_ADD_CO_U32_e64 [[V_MOV_B32_e32_]], [[DEF]], 0, implicit $exec
93 ; GCN-NEXT: S_ENDPGM 0, implicit [[V_ADD_CO_U32_e64_]]
94 %0:sreg_32_xm0 = IMPLICIT_DEF
95 %1:vgpr_32 = V_MOV_B32_e32 12345, implicit $exec
96 %2:vgpr_32, %3:sreg_64 = V_ADD_CO_U32_e64 %0, %1, 0, implicit $exec
97 S_ENDPGM 0, implicit %2
103 name: shrink_scalar_imm_vgpr_v_add_i32_e64_live_vcc_use
104 tracksRegLiveness: true
108 ; GCN-LABEL: name: shrink_scalar_imm_vgpr_v_add_i32_e64_live_vcc_use
109 ; GCN: $vcc = S_MOV_B64 -1
110 ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32_xm0 = S_MOV_B32 12345
111 ; GCN-NEXT: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
112 ; GCN-NEXT: [[V_ADD_CO_U32_e64_:%[0-9]+]]:vgpr_32, [[V_ADD_CO_U32_e64_1:%[0-9]+]]:sreg_64 = V_ADD_CO_U32_e64 [[S_MOV_B32_]], [[DEF]], 0, implicit $exec
113 ; GCN-NEXT: S_ENDPGM 0, implicit [[V_ADD_CO_U32_e64_]], implicit $vcc
115 %0:sreg_32_xm0 = S_MOV_B32 12345
116 %1:vgpr_32 = IMPLICIT_DEF
117 %2:vgpr_32, %3:sreg_64 = V_ADD_CO_U32_e64 %0, %1, 0, implicit $exec
118 S_ENDPGM 0, implicit %2, implicit $vcc
124 name: shrink_scalar_imm_vgpr_v_add_i32_e64_liveout_vcc_use
125 tracksRegLiveness: true
128 ; GCN-LABEL: name: shrink_scalar_imm_vgpr_v_add_i32_e64_liveout_vcc_use
130 ; GCN-NEXT: successors: %bb.1(0x80000000)
132 ; GCN-NEXT: $vcc = S_MOV_B64 -1
133 ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32_xm0 = S_MOV_B32 12345
134 ; GCN-NEXT: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
135 ; GCN-NEXT: [[V_ADD_CO_U32_e64_:%[0-9]+]]:vgpr_32, [[V_ADD_CO_U32_e64_1:%[0-9]+]]:sreg_64 = V_ADD_CO_U32_e64 [[S_MOV_B32_]], [[DEF]], 0, implicit $exec
138 ; GCN-NEXT: liveins: $vcc
140 ; GCN-NEXT: S_ENDPGM 0, implicit [[V_ADD_CO_U32_e64_]], implicit $vcc
144 %0:sreg_32_xm0 = S_MOV_B32 12345
145 %1:vgpr_32 = IMPLICIT_DEF
146 %2:vgpr_32, %3:sreg_64 = V_ADD_CO_U32_e64 %0, %1, 0, implicit $exec
150 S_ENDPGM 0, implicit %2, implicit $vcc
155 name: shrink_scalar_imm_vgpr_v_add_i32_e64_liveout_vcc_lo_use
156 tracksRegLiveness: true
159 ; GCN-LABEL: name: shrink_scalar_imm_vgpr_v_add_i32_e64_liveout_vcc_lo_use
161 ; GCN-NEXT: successors: %bb.1(0x80000000)
163 ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32_xm0 = S_MOV_B32 12345
164 ; GCN-NEXT: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
165 ; GCN-NEXT: [[V_ADD_CO_U32_e64_:%[0-9]+]]:vgpr_32, [[V_ADD_CO_U32_e64_1:%[0-9]+]]:sreg_64 = V_ADD_CO_U32_e64 [[S_MOV_B32_]], [[DEF]], 0, implicit $exec
168 ; GCN-NEXT: liveins: $vcc_lo
170 ; GCN-NEXT: S_ENDPGM 0, implicit [[V_ADD_CO_U32_e64_]], implicit $vcc_lo
174 %0:sreg_32_xm0 = S_MOV_B32 12345
175 %1:vgpr_32 = IMPLICIT_DEF
176 %2:vgpr_32, %3:sreg_64 = V_ADD_CO_U32_e64 %0, %1, 0, implicit $exec
180 S_ENDPGM 0, implicit %2, implicit $vcc_lo
185 # This is not OK to clobber because vcc_lo has a livein use.
187 name: shrink_scalar_imm_vgpr_v_add_i32_e64_livein_vcc
188 tracksRegLiveness: true
191 ; GCN-LABEL: name: shrink_scalar_imm_vgpr_v_add_i32_e64_livein_vcc
193 ; GCN-NEXT: successors: %bb.1(0x80000000)
195 ; GCN-NEXT: $vcc = S_MOV_B64 -1
198 ; GCN-NEXT: liveins: $vcc
200 ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32_xm0 = S_MOV_B32 12345
201 ; GCN-NEXT: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
202 ; GCN-NEXT: [[V_ADD_CO_U32_e64_:%[0-9]+]]:vgpr_32, [[V_ADD_CO_U32_e64_1:%[0-9]+]]:sreg_64 = V_ADD_CO_U32_e64 [[S_MOV_B32_]], [[DEF]], 0, implicit $exec
203 ; GCN-NEXT: S_ENDPGM 0, implicit [[V_ADD_CO_U32_e64_]], implicit $vcc_lo
210 %0:sreg_32_xm0 = S_MOV_B32 12345
211 %1:vgpr_32 = IMPLICIT_DEF
212 %2:vgpr_32, %3:sreg_64 = V_ADD_CO_U32_e64 %0, %1, 0, implicit $exec
213 S_ENDPGM 0, implicit %2, implicit $vcc_lo
218 name: shrink_scalar_imm_vgpr_v_add_i32_e64_livein_vcc_hi
219 tracksRegLiveness: true
222 ; GCN-LABEL: name: shrink_scalar_imm_vgpr_v_add_i32_e64_livein_vcc_hi
224 ; GCN-NEXT: successors: %bb.1(0x80000000)
226 ; GCN-NEXT: $vcc_hi = S_MOV_B32 -1
229 ; GCN-NEXT: successors: %bb.2(0x80000000)
230 ; GCN-NEXT: liveins: $vcc_hi
232 ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32_xm0 = S_MOV_B32 12345
233 ; GCN-NEXT: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
234 ; GCN-NEXT: [[V_ADD_CO_U32_e64_:%[0-9]+]]:vgpr_32, [[V_ADD_CO_U32_e64_1:%[0-9]+]]:sreg_64 = V_ADD_CO_U32_e64 [[S_MOV_B32_]], [[DEF]], 0, implicit $exec
237 ; GCN-NEXT: liveins: $vcc_hi
239 ; GCN-NEXT: S_ENDPGM 0, implicit [[V_ADD_CO_U32_e64_]], implicit $vcc_hi
242 $vcc_hi = S_MOV_B32 -1
246 %0:sreg_32_xm0 = S_MOV_B32 12345
247 %1:vgpr_32 = IMPLICIT_DEF
248 %2:vgpr_32, %3:sreg_64 = V_ADD_CO_U32_e64 %0, %1, 0, implicit $exec
253 S_ENDPGM 0, implicit %2, implicit $vcc_hi
259 name: shrink_scalar_imm_vgpr_v_sub_i32_e64_no_carry_out_use
260 tracksRegLiveness: true
264 ; GCN-LABEL: name: shrink_scalar_imm_vgpr_v_sub_i32_e64_no_carry_out_use
265 ; GCN: [[S_MOV_B32_:%[0-9]+]]:sreg_32_xm0 = S_MOV_B32 12345
266 ; GCN-NEXT: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
267 ; GCN-NEXT: [[V_SUB_CO_U32_e32_:%[0-9]+]]:vgpr_32 = V_SUB_CO_U32_e32 [[S_MOV_B32_]], [[DEF]], implicit-def $vcc, implicit $exec
268 ; GCN-NEXT: S_ENDPGM 0, implicit [[V_SUB_CO_U32_e32_]]
269 %0:sreg_32_xm0 = S_MOV_B32 12345
270 %1:vgpr_32 = IMPLICIT_DEF
271 %2:vgpr_32, %3:sreg_64 = V_SUB_CO_U32_e64 %0, %1, 0, implicit $exec
272 S_ENDPGM 0, implicit %2
278 name: shrink_vgpr_scalar_imm_v_sub_i32_e64_no_carry_out_use
279 tracksRegLiveness: true
283 ; GCN-LABEL: name: shrink_vgpr_scalar_imm_v_sub_i32_e64_no_carry_out_use
284 ; GCN: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
285 ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32_xm0 = S_MOV_B32 12345
286 ; GCN-NEXT: [[V_SUBREV_CO_U32_e32_:%[0-9]+]]:vgpr_32 = V_SUBREV_CO_U32_e32 [[S_MOV_B32_]], [[DEF]], implicit-def $vcc, implicit $exec
287 ; GCN-NEXT: S_ENDPGM 0, implicit [[V_SUBREV_CO_U32_e32_]]
288 %0:vgpr_32 = IMPLICIT_DEF
289 %1:sreg_32_xm0 = S_MOV_B32 12345
290 %2:vgpr_32, %3:sreg_64 = V_SUB_CO_U32_e64 %0, %1, 0, implicit $exec
291 S_ENDPGM 0, implicit %2
297 name: shrink_scalar_imm_vgpr_v_subrev_i32_e64_no_carry_out_use
298 tracksRegLiveness: true
302 ; GCN-LABEL: name: shrink_scalar_imm_vgpr_v_subrev_i32_e64_no_carry_out_use
303 ; GCN: [[S_MOV_B32_:%[0-9]+]]:sreg_32_xm0 = S_MOV_B32 12345
304 ; GCN-NEXT: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
305 ; GCN-NEXT: [[V_SUBREV_CO_U32_e32_:%[0-9]+]]:vgpr_32 = V_SUBREV_CO_U32_e32 [[S_MOV_B32_]], [[DEF]], implicit-def $vcc, implicit $exec
306 ; GCN-NEXT: S_ENDPGM 0, implicit [[V_SUBREV_CO_U32_e32_]]
307 %0:sreg_32_xm0 = S_MOV_B32 12345
308 %1:vgpr_32 = IMPLICIT_DEF
309 %2:vgpr_32, %3:sreg_64 = V_SUBREV_CO_U32_e64 %0, %1, 0, implicit $exec
310 S_ENDPGM 0, implicit %2
316 name: shrink_vgpr_scalar_imm_v_subrev_i32_e64_no_carry_out_use
317 tracksRegLiveness: true
321 ; GCN-LABEL: name: shrink_vgpr_scalar_imm_v_subrev_i32_e64_no_carry_out_use
322 ; GCN: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
323 ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32_xm0 = S_MOV_B32 12345
324 ; GCN-NEXT: [[V_SUB_CO_U32_e32_:%[0-9]+]]:vgpr_32 = V_SUB_CO_U32_e32 [[S_MOV_B32_]], [[DEF]], implicit-def $vcc, implicit $exec
325 ; GCN-NEXT: S_ENDPGM 0, implicit [[V_SUB_CO_U32_e32_]]
326 %0:vgpr_32 = IMPLICIT_DEF
327 %1:sreg_32_xm0 = S_MOV_B32 12345
328 %2:vgpr_32, %3:sreg_64 = V_SUBREV_CO_U32_e64 %0, %1, 0, implicit $exec
329 S_ENDPGM 0, implicit %2
335 # We know this is OK because vcc isn't live out of the block.
337 name: shrink_scalar_imm_vgpr_v_add_i32_e64_known_no_liveout
338 tracksRegLiveness: true
341 ; GCN-LABEL: name: shrink_scalar_imm_vgpr_v_add_i32_e64_known_no_liveout
343 ; GCN-NEXT: successors: %bb.1(0x80000000)
345 ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32_xm0 = S_MOV_B32 12345
346 ; GCN-NEXT: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
347 ; GCN-NEXT: [[V_ADD_CO_U32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_CO_U32_e32 [[S_MOV_B32_]], [[DEF]], implicit-def $vcc, implicit $exec
350 ; GCN-NEXT: S_ENDPGM 0, implicit [[V_ADD_CO_U32_e32_]]
384 %0:sreg_32_xm0 = S_MOV_B32 12345
385 %1:vgpr_32 = IMPLICIT_DEF
386 %2:vgpr_32, %3:sreg_64 = V_ADD_CO_U32_e64 %0, %1, 0, implicit $exec
391 S_ENDPGM 0, implicit %2
397 # We know this is OK because vcc isn't live out of the block, even
398 # though it had a defined but unused. value
400 name: shrink_scalar_imm_vgpr_v_add_i32_e64_known_no_liveout_dead_vcc_def
401 tracksRegLiveness: true
404 ; GCN-LABEL: name: shrink_scalar_imm_vgpr_v_add_i32_e64_known_no_liveout_dead_vcc_def
406 ; GCN-NEXT: successors: %bb.1(0x80000000)
408 ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32_xm0 = S_MOV_B32 12345
409 ; GCN-NEXT: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
410 ; GCN-NEXT: [[V_ADD_CO_U32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_CO_U32_e32 [[S_MOV_B32_]], [[DEF]], implicit-def $vcc, implicit $exec
413 ; GCN-NEXT: S_ENDPGM 0, implicit [[V_ADD_CO_U32_e32_]]
417 S_NOP 0, implicit-def $vcc
418 %0:sreg_32_xm0 = S_MOV_B32 12345
419 %1:vgpr_32 = IMPLICIT_DEF
420 %2:vgpr_32, %3:sreg_64 = V_ADD_CO_U32_e64 %0, %1, 0, implicit $exec
425 S_ENDPGM 0, implicit %2
430 # This requires searching through many DBG_VALUE instructions before the insert poitn, which
431 # should not count against the search limit.
433 name: vcc_liveness_dbg_value_search_before
434 tracksRegLiveness: true
438 ; GCN-LABEL: name: vcc_liveness_dbg_value_search_before
439 ; GCN: [[S_MOV_B32_:%[0-9]+]]:sreg_32_xm0 = S_MOV_B32 12345
440 ; GCN-NEXT: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
441 ; GCN-NEXT: DBG_VALUE $noreg, 0
442 ; GCN-NEXT: DBG_VALUE $noreg, 0
443 ; GCN-NEXT: DBG_VALUE $noreg, 0
444 ; GCN-NEXT: DBG_VALUE $noreg, 0
445 ; GCN-NEXT: DBG_VALUE $noreg, 0
446 ; GCN-NEXT: DBG_VALUE $noreg, 0
447 ; GCN-NEXT: DBG_VALUE $noreg, 0
448 ; GCN-NEXT: DBG_VALUE $noreg, 0
449 ; GCN-NEXT: DBG_VALUE $noreg, 0
450 ; GCN-NEXT: DBG_VALUE $noreg, 0
451 ; GCN-NEXT: DBG_VALUE $noreg, 0
452 ; GCN-NEXT: DBG_VALUE $noreg, 0
453 ; GCN-NEXT: DBG_VALUE $noreg, 0
454 ; GCN-NEXT: DBG_VALUE $noreg, 0
455 ; GCN-NEXT: DBG_VALUE $noreg, 0
456 ; GCN-NEXT: DBG_VALUE $noreg, 0
457 ; GCN-NEXT: DBG_VALUE $noreg, 0
458 ; GCN-NEXT: DBG_VALUE $noreg, 0
459 ; GCN-NEXT: DBG_VALUE $noreg, 0
460 ; GCN-NEXT: DBG_VALUE $noreg, 0
461 ; GCN-NEXT: DBG_VALUE $noreg, 0
462 ; GCN-NEXT: DBG_VALUE $noreg, 0
463 ; GCN-NEXT: DBG_VALUE $noreg, 0
464 ; GCN-NEXT: DBG_VALUE $noreg, 0
465 ; GCN-NEXT: DBG_VALUE $noreg, 0
466 ; GCN-NEXT: DBG_VALUE $noreg, 0
467 ; GCN-NEXT: DBG_VALUE $noreg, 0
468 ; GCN-NEXT: DBG_VALUE $noreg, 0
469 ; GCN-NEXT: [[V_ADD_CO_U32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_CO_U32_e32 [[S_MOV_B32_]], [[DEF]], implicit-def $vcc, implicit $exec
470 ; GCN-NEXT: S_ENDPGM 0, implicit [[V_ADD_CO_U32_e32_]]
471 %0:sreg_32_xm0 = S_MOV_B32 12345
472 %1:vgpr_32 = IMPLICIT_DEF
501 %2:vgpr_32, %3:sreg_64 = V_ADD_CO_U32_e64 %0, %1, 0, implicit $exec
502 S_ENDPGM 0, implicit %2
507 # This requires searching through many DBG_VALUE instructions after the insert point, which
508 # should not count against the search limit.
510 name: vcc_liveness_dbg_value_search_after
511 tracksRegLiveness: true
515 ; GCN-LABEL: name: vcc_liveness_dbg_value_search_after
516 ; GCN: [[S_MOV_B32_:%[0-9]+]]:sreg_32_xm0 = S_MOV_B32 12345
517 ; GCN-NEXT: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
518 ; GCN-NEXT: [[V_ADD_CO_U32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_CO_U32_e32 [[S_MOV_B32_]], [[DEF]], implicit-def $vcc, implicit $exec
519 ; GCN-NEXT: DBG_VALUE $noreg, 0
520 ; GCN-NEXT: DBG_VALUE $noreg, 0
521 ; GCN-NEXT: DBG_VALUE $noreg, 0
522 ; GCN-NEXT: DBG_VALUE $noreg, 0
523 ; GCN-NEXT: DBG_VALUE $noreg, 0
524 ; GCN-NEXT: DBG_VALUE $noreg, 0
525 ; GCN-NEXT: DBG_VALUE $noreg, 0
526 ; GCN-NEXT: DBG_VALUE $noreg, 0
527 ; GCN-NEXT: DBG_VALUE $noreg, 0
528 ; GCN-NEXT: DBG_VALUE $noreg, 0
529 ; GCN-NEXT: DBG_VALUE $noreg, 0
530 ; GCN-NEXT: DBG_VALUE $noreg, 0
531 ; GCN-NEXT: DBG_VALUE $noreg, 0
532 ; GCN-NEXT: DBG_VALUE $noreg, 0
533 ; GCN-NEXT: DBG_VALUE $noreg, 0
534 ; GCN-NEXT: DBG_VALUE $noreg, 0
535 ; GCN-NEXT: DBG_VALUE $noreg, 0
536 ; GCN-NEXT: DBG_VALUE $noreg, 0
537 ; GCN-NEXT: DBG_VALUE $noreg, 0
538 ; GCN-NEXT: DBG_VALUE $noreg, 0
539 ; GCN-NEXT: DBG_VALUE $noreg, 0
540 ; GCN-NEXT: DBG_VALUE $noreg, 0
541 ; GCN-NEXT: DBG_VALUE $noreg, 0
542 ; GCN-NEXT: DBG_VALUE $noreg, 0
543 ; GCN-NEXT: DBG_VALUE $noreg, 0
544 ; GCN-NEXT: DBG_VALUE $noreg, 0
545 ; GCN-NEXT: DBG_VALUE $noreg, 0
546 ; GCN-NEXT: DBG_VALUE $noreg, 0
547 ; GCN-NEXT: S_ENDPGM 0, implicit [[V_ADD_CO_U32_e32_]]
548 %0:sreg_32_xm0 = S_MOV_B32 12345
549 %1:vgpr_32 = IMPLICIT_DEF
578 %2:vgpr_32, %3:sreg_64 = V_ADD_CO_U32_e64 %0, %1, 0, implicit $exec
608 S_ENDPGM 0, implicit %2
613 name: shrink_add_kill_flags_src0
614 tracksRegLiveness: true
618 ; GCN-LABEL: name: shrink_add_kill_flags_src0
619 ; GCN: liveins: $vgpr0
621 ; GCN-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
622 ; GCN-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 518144, implicit $exec
623 ; GCN-NEXT: [[V_ADD_CO_U32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_CO_U32_e32 killed [[V_MOV_B32_e32_]], [[COPY]], implicit-def $vcc, implicit $exec
624 ; GCN-NEXT: S_ENDPGM 0, implicit [[V_ADD_CO_U32_e32_]]
625 %0:vgpr_32 = COPY $vgpr0
626 %1:vgpr_32 = V_MOV_B32_e32 518144, implicit $exec
627 %2:vgpr_32, %3:sreg_64_xexec = V_ADD_CO_U32_e64 killed %1, %0, 0, implicit $exec
628 S_ENDPGM 0, implicit %2
632 name: shrink_add_kill_flags_src1
633 tracksRegLiveness: true
637 ; GCN-LABEL: name: shrink_add_kill_flags_src1
638 ; GCN: liveins: $vgpr0
640 ; GCN-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
641 ; GCN-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 518144, implicit $exec
642 ; GCN-NEXT: [[V_ADD_CO_U32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_CO_U32_e32 [[V_MOV_B32_e32_]], killed [[COPY]], implicit-def $vcc, implicit $exec
643 ; GCN-NEXT: S_ENDPGM 0, implicit [[V_ADD_CO_U32_e32_]]
644 %0:vgpr_32 = COPY $vgpr0
645 %1:vgpr_32 = V_MOV_B32_e32 518144, implicit $exec
646 %2:vgpr_32, %3:sreg_64_xexec = V_ADD_CO_U32_e64 %1, killed %0, 0, implicit $exec
647 S_ENDPGM 0, implicit %2
651 name: shrink_addc_kill_flags_src2
652 tracksRegLiveness: true
655 liveins: $vgpr0, $vcc
656 ; GCN-LABEL: name: shrink_addc_kill_flags_src2
657 ; GCN: liveins: $vgpr0, $vcc
659 ; GCN-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
660 ; GCN-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 518144, implicit $exec
661 ; GCN-NEXT: [[COPY1:%[0-9]+]]:sreg_64_xexec = COPY $vcc
662 ; GCN-NEXT: [[V_ADDC_U32_e64_:%[0-9]+]]:vgpr_32, [[V_ADDC_U32_e64_1:%[0-9]+]]:sreg_64_xexec = V_ADDC_U32_e64 [[V_MOV_B32_e32_]], [[COPY]], [[COPY1]], 0, implicit $exec
663 ; GCN-NEXT: S_ENDPGM 0, implicit [[V_ADDC_U32_e64_]]
664 %0:vgpr_32 = COPY $vgpr0
665 %1:vgpr_32 = V_MOV_B32_e32 518144, implicit $exec
666 %2:sreg_64_xexec = COPY $vcc
667 %3:vgpr_32, %4:sreg_64_xexec = V_ADDC_U32_e64 %1, %0, %2, 0, implicit $exec
668 S_ENDPGM 0, implicit %3