1 # RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass si-shrink-instructions -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %s
3 # GCN-LABEL: name: swap_phys_condensed
5 # GCN-NEXT: $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
6 # GCN-NEXT: $vgpr0, $vgpr1 = V_SWAP_B32 $vgpr1, $vgpr0, implicit $exec
7 # GCN-NEXT: S_SETPC_B64_return
9 name: swap_phys_condensed
12 liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
13 $vgpr2 = V_MOV_B32_e32 killed $vgpr0, implicit $exec
14 $vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
15 $vgpr1 = V_MOV_B32_e32 killed $vgpr2, implicit $exec
16 S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0, implicit $vgpr1
19 # GCN-LABEL: name: swap_phys_sparse
21 # GCN-NEXT: $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
22 # GCN-NEXT: $vgpr3 = V_MOV_B32_e32 killed $vgpr4, implicit $exec
23 # GCN-NEXT: $vgpr0, $vgpr1 = V_SWAP_B32 $vgpr1, $vgpr0, implicit $exec
24 # GCN-NEXT: $vgpr5 = V_MOV_B32_e32 killed $vgpr6, implicit $exec
25 # GCN-NEXT: S_SETPC_B64_return
27 name: swap_phys_sparse
30 liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
31 $vgpr2 = V_MOV_B32_e32 killed $vgpr0, implicit $exec
32 $vgpr3 = V_MOV_B32_e32 killed $vgpr4, implicit $exec
33 $vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
34 $vgpr5 = V_MOV_B32_e32 killed $vgpr6, implicit $exec
35 $vgpr1 = V_MOV_B32_e32 killed $vgpr2, implicit $exec
36 S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0, implicit $vgpr1
39 # GCN-LABEL: name: swap_phys_liveout
41 # GCN-NEXT: $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
42 # GCN-NEXT: $vgpr0, $vgpr1 = V_SWAP_B32 $vgpr1, $vgpr0, implicit $exec
43 # GCN-NEXT: S_SETPC_B64_return
45 name: swap_phys_liveout
48 liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
49 $vgpr2 = V_MOV_B32_e32 killed $vgpr0, implicit $exec
50 $vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
51 $vgpr1 = V_MOV_B32_e32 killed $vgpr2, implicit $exec
52 S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0, implicit $vgpr2, implicit $vgpr1
55 # GCN-LABEL: name: swap_phys_liveout_superreg
57 # GCN-NEXT: $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
58 # GCN-NEXT: $vgpr0, $vgpr1 = V_SWAP_B32 $vgpr1, $vgpr0, implicit $exec
59 # GCN-NEXT: S_SETPC_B64_return
61 name: swap_phys_liveout_superreg
64 liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
65 $vgpr2 = V_MOV_B32_e32 killed $vgpr0, implicit $exec
66 $vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
67 $vgpr1 = V_MOV_B32_e32 killed $vgpr2, implicit $exec
68 S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0, implicit $vgpr2_vgpr3, implicit $vgpr1
71 # GCN-LABEL: name: swap_phys_b64
73 # GCN-NEXT: $vgpr4_vgpr5 = COPY $vgpr0_vgpr1
74 # GCN-NEXT: $vgpr0, $vgpr2 = V_SWAP_B32 $vgpr2, $vgpr0, implicit $exec
75 # GCN-NEXT: $vgpr1, $vgpr3 = V_SWAP_B32 $vgpr3, $vgpr1, implicit $exec
80 $vgpr4_vgpr5 = COPY killed $vgpr0_vgpr1
81 $vgpr0_vgpr1 = COPY killed $vgpr2_vgpr3
82 $vgpr2_vgpr3 = COPY killed $vgpr4_vgpr5
85 # GCN-LABEL: name: swap_phys_overlap_x
87 # GCN-NEXT: $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
88 # GCN-NEXT: $vgpr3_vgpr4 = V_ADD_F64_e64 0, $vgpr0_vgpr1, 0, $vgpr3_vgpr4, 0, 0, implicit $mode, implicit $exec
89 # GCN-NEXT: $vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
90 # GCN-NEXT: $vgpr1 = V_MOV_B32_e32 killed $vgpr2, implicit $exec
92 name: swap_phys_overlap_x
95 $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
96 $vgpr3_vgpr4 = V_ADD_F64_e64 0, $vgpr0_vgpr1, 0, $vgpr3_vgpr4, 0, 0, implicit $mode, implicit $exec
97 $vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
98 $vgpr1 = V_MOV_B32_e32 killed $vgpr2, implicit $exec
101 # GCN-LABEL: name: swap_phys_clobber_y
103 # GCN-NEXT: $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
104 # GCN-NEXT: $vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
105 # GCN-NEXT: $vgpr1 = V_MOV_B32_e32 0, implicit $exec
106 # GCN-NEXT: $vgpr1 = V_MOV_B32_e32 killed $vgpr2, implicit $exec
108 name: swap_phys_clobber_y
111 $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
112 $vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
113 $vgpr1 = V_MOV_B32_e32 0, implicit $exec
114 $vgpr1 = V_MOV_B32_e32 killed $vgpr2, implicit $exec
118 # GCN-LABEL: name: swap_virt_copy_condense
119 # GCN: %0:vgpr_32, %1:vgpr_32 = V_SWAP_B32 %1, %0, implicit $exec
121 name: swap_virt_copy_condense
123 - { id: 0, class: vgpr_32 }
124 - { id: 1, class: vgpr_32 }
125 - { id: 2, class: vgpr_32 }
135 # GCN-LABEL: name: swap_virt_copy_sparse
136 # GCN: %0:vgpr_32, %1:vgpr_32 = V_SWAP_B32 %1, %0, implicit $exec
138 name: swap_virt_copy_sparse
140 - { id: 0, class: vgpr_32 }
141 - { id: 1, class: vgpr_32 }
142 - { id: 2, class: vgpr_32 }
154 # GCN-LABEL: name: swap_virt_copy_subreg
155 # GCN: %0.sub0:vreg_64, %1.sub0:vreg_64 = V_SWAP_B32 %1.sub0, %0.sub0, implicit $exec
157 name: swap_virt_copy_subreg
159 - { id: 0, class: vreg_64 }
160 - { id: 1, class: vreg_64 }
161 - { id: 2, class: vreg_64 }
166 %2.sub0 = COPY %0.sub0
167 %2.sub1 = COPY %0.sub1
168 %0.sub0 = COPY %1.sub0
169 %0.sub1 = COPY %1.sub1
170 %1.sub0 = COPY %2.sub0
173 # GCN-LABEL: name: swap_virt_mov
174 # GCN: %0:vgpr_32, %1:vgpr_32 = V_SWAP_B32 %1, %0, implicit $exec
178 - { id: 0, class: vgpr_32 }
179 - { id: 1, class: vgpr_32 }
180 - { id: 2, class: vgpr_32 }
185 %2 = V_MOV_B32_e32 %0, implicit $exec
186 %0 = V_MOV_B32_e32 %1, implicit $exec
187 %1 = V_MOV_B32_e32 %2, implicit $exec
190 # GCN-LABEL: name: swap_virt_read_x
192 # GCN-NEXT: %0:vgpr_32 = IMPLICIT_DEF
193 # GCN-NEXT: %1:vgpr_32 = IMPLICIT_DEF
194 # GCN-NEXT: %2:vgpr_32 = COPY %0
195 # GCN-NEXT: %3:vgpr_32 = COPY %0
196 # GCN-NEXT: %0:vgpr_32 = COPY %1
197 # GCN-NEXT: %1:vgpr_32 = COPY %2
198 # GCN-NEXT: S_ENDPGM 0
201 name: swap_virt_read_x
203 - { id: 0, class: vgpr_32 }
204 - { id: 1, class: vgpr_32 }
205 - { id: 2, class: vgpr_32 }
206 - { id: 3, class: vgpr_32 }
218 # GCN-LABEL: name: swap_virt_read_t_twice
220 # GCN-NEXT: %0:vgpr_32 = IMPLICIT_DEF
221 # GCN-NEXT: %1:vgpr_32 = IMPLICIT_DEF
222 # GCN-NEXT: %2:vgpr_32 = COPY %0
223 # GCN-NEXT: %3:vgpr_32 = COPY %2
224 # GCN-NEXT: %0:vgpr_32, %1:vgpr_32 = V_SWAP_B32 %1, %0, implicit $exec
225 # GCN-NEXT: S_ENDPGM 0
228 name: swap_virt_read_t_twice
230 - { id: 0, class: vgpr_32 }
231 - { id: 1, class: vgpr_32 }
232 - { id: 2, class: vgpr_32 }
233 - { id: 3, class: vgpr_32 }
245 # GCN-LABEL: name: swap_virt_clobber_y
247 # GCN-NEXT: %0:vgpr_32 = IMPLICIT_DEF
248 # GCN-NEXT: %1:vgpr_32 = IMPLICIT_DEF
249 # GCN-NEXT: %2:vgpr_32 = COPY %0
250 # GCN-NEXT: %0:vgpr_32 = COPY %1
251 # GCN-NEXT: %1:vgpr_32 = IMPLICIT_DEF
252 # GCN-NEXT: %1:vgpr_32 = COPY %2
253 # GCN-NEXT: S_ENDPGM 0
256 name: swap_virt_clobber_y
258 - { id: 0, class: vgpr_32 }
259 - { id: 1, class: vgpr_32 }
260 - { id: 2, class: vgpr_32 }
272 # GCN-LABEL: name: swap_virt_clobber_x1
274 # GCN-NEXT: %0:vgpr_32 = IMPLICIT_DEF
275 # GCN-NEXT: %1:vgpr_32 = IMPLICIT_DEF
276 # GCN-NEXT: %2:vgpr_32 = COPY %0
277 # GCN-NEXT: %0:vgpr_32 = COPY %1
278 # GCN-NEXT: %0:vgpr_32 = IMPLICIT_DEF
279 # GCN-NEXT: %1:vgpr_32 = COPY %2
280 # GCN-NEXT: S_ENDPGM 0
283 name: swap_virt_clobber_x1
285 - { id: 0, class: vgpr_32 }
286 - { id: 1, class: vgpr_32 }
287 - { id: 2, class: vgpr_32 }
299 # GCN-LABEL: name: swap_virt_clobber_x2
301 # GCN-NEXT: %0:vgpr_32 = IMPLICIT_DEF
302 # GCN-NEXT: %1:vgpr_32 = IMPLICIT_DEF
303 # GCN-NEXT: %2:vgpr_32 = COPY %0
304 # GCN-NEXT: %0:vgpr_32 = IMPLICIT_DEF
305 # GCN-NEXT: %0:vgpr_32 = COPY %1
306 # GCN-NEXT: %1:vgpr_32 = COPY %2
307 # GCN-NEXT: S_ENDPGM 0
310 name: swap_virt_clobber_x2
312 - { id: 0, class: vgpr_32 }
313 - { id: 1, class: vgpr_32 }
314 - { id: 2, class: vgpr_32 }
326 # GCN-LABEL: name: swap_virt_clobber_t
328 # GCN-NEXT: %0:vgpr_32 = IMPLICIT_DEF
329 # GCN-NEXT: %1:vgpr_32 = IMPLICIT_DEF
330 # GCN-NEXT: %2:vgpr_32 = COPY %0
331 # GCN-NEXT: %0:vgpr_32 = COPY %1
332 # GCN-NEXT: %2:vgpr_32 = IMPLICIT_DEF
333 # GCN-NEXT: %1:vgpr_32 = COPY %2
334 # GCN-NEXT: S_ENDPGM 0
337 name: swap_virt_clobber_t
339 - { id: 0, class: vgpr_32 }
340 - { id: 1, class: vgpr_32 }
341 - { id: 2, class: vgpr_32 }
353 # GCN-LABEL: name: swap_virt_copy_subreg_overlap_x_full
355 # GCN-NEXT: %0:vreg_64 = IMPLICIT_DEF
356 # GCN-NEXT: %1:vreg_64 = IMPLICIT_DEF
357 # GCN-NEXT: %2.sub0:vreg_64 = COPY %0.sub0
358 # GCN-NEXT: %3:vreg_64 = COPY %0
359 # GCN-NEXT: %0.sub0:vreg_64 = COPY %1.sub0
360 # GCN-NEXT: %1.sub0:vreg_64 = COPY %2.sub0
362 name: swap_virt_copy_subreg_overlap_x_full
364 - { id: 0, class: vreg_64 }
365 - { id: 1, class: vreg_64 }
366 - { id: 2, class: vreg_64 }
367 - { id: 3, class: vreg_64 }
372 %2.sub0 = COPY %0.sub0
374 %0.sub0 = COPY %1.sub0
375 %1.sub0 = COPY %2.sub0
378 # GCN-LABEL: name: swap_virt_copy_subreg_overlap_x_part
380 # GCN-NEXT: %0:vreg_128 = IMPLICIT_DEF
381 # GCN-NEXT: %1:vreg_64 = IMPLICIT_DEF
382 # GCN-NEXT: %2.sub0:vreg_64 = COPY %0.sub0
383 # GCN-NEXT: %3:vreg_64 = COPY %0.sub0_sub1
384 # GCN-NEXT: %0.sub0:vreg_128 = COPY %1.sub0
385 # GCN-NEXT: %1.sub0:vreg_64 = COPY %2.sub0
387 name: swap_virt_copy_subreg_overlap_x_part
389 - { id: 0, class: vreg_128 }
390 - { id: 1, class: vreg_64 }
391 - { id: 2, class: vreg_64 }
392 - { id: 3, class: vreg_64 }
397 %2.sub0 = COPY %0.sub0
398 %3 = COPY %0.sub0_sub1
399 %0.sub0 = COPY %1.sub0
400 %1.sub0 = COPY %2.sub0
403 # GCN-LABEL: name: swap_virt_copy_subreg_wide_y
405 # GCN-NEXT: %0:vreg_64 = IMPLICIT_DEF
406 # GCN-NEXT: %1:vreg_64 = IMPLICIT_DEF
407 # GCN-NEXT: %2.sub0:vreg_64 = COPY %0.sub0
408 # GCN-NEXT: %0.sub0:vreg_64 = COPY %1.sub0
409 # GCN-NEXT: %1:vreg_64 = COPY %2
411 name: swap_virt_copy_subreg_wide_y
413 - { id: 0, class: vreg_64 }
414 - { id: 1, class: vreg_64 }
415 - { id: 2, class: vreg_64 }
420 %2.sub0 = COPY %0.sub0
421 %0.sub0 = COPY %1.sub0
425 # GCN-LABEL: name: swap_virt_b64
427 # GCN-NEXT: %0:vreg_64 = IMPLICIT_DEF
428 # GCN-NEXT: %1:vreg_64 = IMPLICIT_DEF
429 # GCN-NEXT: %0.sub0:vreg_64, %1.sub0:vreg_64 = V_SWAP_B32 %1.sub0, %0.sub0, implicit $exec
430 # GCN-NEXT: %0.sub1:vreg_64, %1.sub1:vreg_64 = V_SWAP_B32 %1.sub1, %0.sub1, implicit $exec
434 - { id: 0, class: vreg_64 }
435 - { id: 1, class: vreg_64 }
436 - { id: 2, class: vreg_64 }
446 # GCN-LABEL: name: swap_virt_b128
448 # GCN-NEXT: %0:vreg_128 = IMPLICIT_DEF
449 # GCN-NEXT: %1:vreg_128 = IMPLICIT_DEF
450 # GCN-NEXT: %0.sub0:vreg_128, %1.sub0:vreg_128 = V_SWAP_B32 %1.sub0, %0.sub0, implicit $exec
451 # GCN-NEXT: %0.sub1:vreg_128, %1.sub1:vreg_128 = V_SWAP_B32 %1.sub1, %0.sub1, implicit $exec
452 # GCN-NEXT: %0.sub2:vreg_128, %1.sub2:vreg_128 = V_SWAP_B32 %1.sub2, %0.sub2, implicit $exec
453 # GCN-NEXT: %0.sub3:vreg_128, %1.sub3:vreg_128 = V_SWAP_B32 %1.sub3, %0.sub3, implicit $exec
457 - { id: 0, class: vreg_128 }
458 - { id: 1, class: vreg_128 }
459 - { id: 2, class: vreg_128 }
469 # GCN-LABEL: name: swap_virt_b128_sub0_1
471 # GCN-NEXT: %0:vreg_128 = IMPLICIT_DEF
472 # GCN-NEXT: %1:vreg_128 = IMPLICIT_DEF
473 # GCN-NEXT: %0.sub0:vreg_128, %1.sub0:vreg_128 = V_SWAP_B32 %1.sub0, %0.sub0, implicit $exec
474 # GCN-NEXT: %0.sub1:vreg_128, %1.sub1:vreg_128 = V_SWAP_B32 %1.sub1, %0.sub1, implicit $exec
475 # GCN-NEXT: S_ENDPGM 0
477 name: swap_virt_b128_sub0_1
479 - { id: 0, class: vreg_128 }
480 - { id: 1, class: vreg_128 }
481 - { id: 2, class: vreg_128 }
486 %2.sub0_sub1 = COPY %0.sub0_sub1
487 %0.sub0_sub1 = COPY %1.sub0_sub1
488 %1.sub0_sub1 = COPY %2.sub0_sub1
492 # GCN-LABEL: name: swap_virt_b128_sub2_3
494 # GCN-NEXT: %0:vreg_128 = IMPLICIT_DEF
495 # GCN-NEXT: %1:vreg_128 = IMPLICIT_DEF
496 # GCN-NEXT: %0.sub2:vreg_128, %1.sub2:vreg_128 = V_SWAP_B32 %1.sub2, %0.sub2, implicit $exec
497 # GCN-NEXT: %0.sub3:vreg_128, %1.sub3:vreg_128 = V_SWAP_B32 %1.sub3, %0.sub3, implicit $exec
498 # GCN-NEXT: S_ENDPGM 0
500 name: swap_virt_b128_sub2_3
502 - { id: 0, class: vreg_128 }
503 - { id: 1, class: vreg_128 }
504 - { id: 2, class: vreg_128 }
509 %2.sub2_sub3 = COPY %0.sub2_sub3
510 %0.sub2_sub3 = COPY %1.sub2_sub3
511 %1.sub2_sub3 = COPY %2.sub2_sub3
516 # GCN-LABEL: name: swap_virt_s_to_s
518 # GCN-NEXT: %0:sgpr_32 = IMPLICIT_DEF
519 # GCN-NEXT: %1:sgpr_32 = IMPLICIT_DEF
520 # GCN-NEXT: %2:sgpr_32 = COPY %0
521 # GCN-NEXT: %0:sgpr_32 = COPY %1
522 # GCN-NEXT: %1:sgpr_32 = COPY %2
524 name: swap_virt_s_to_s
526 - { id: 0, class: sgpr_32 }
527 - { id: 1, class: sgpr_32 }
528 - { id: 2, class: sgpr_32 }
538 # GCN-LABEL: name: swap_virt_copy_subreg_impdef_super
539 # GCN: %2:vreg_64 = IMPLICIT_DEF
540 # GCN-NEXT: %2.sub1:vreg_64 = COPY %0.sub1
541 # GCN-NEXT: %0.sub0:vreg_64, %1.sub0:vreg_64 = V_SWAP_B32 %1.sub0, %0.sub0, implicit $exec
543 name: swap_virt_copy_subreg_impdef_super
545 - { id: 0, class: vreg_64 }
546 - { id: 1, class: vreg_64 }
547 - { id: 2, class: vreg_64 }
552 %2.sub0 = COPY %0.sub0, implicit-def %2, implicit $exec
553 %2.sub1 = COPY %0.sub1
554 %0.sub0 = COPY %1.sub0
555 %0.sub1 = COPY %1.sub1
556 %1.sub0 = COPY %2.sub0
559 # GCN-LABEL: name: swap_virt_copy_subreg_impuse_x
561 # GCN-NEXT: %0:vreg_64 = IMPLICIT_DEF
562 # GCN-NEXT: %1:vreg_64 = IMPLICIT_DEF
563 # GCN-NEXT: %2.sub0:vreg_64 = COPY %0.sub0
564 # GCN-NEXT: %2.sub1:vreg_64 = COPY %0.sub1
565 # GCN-NEXT: %0.sub0:vreg_64 = COPY %1.sub0, implicit %0
566 # GCN-NEXT: %0.sub1:vreg_64 = COPY %1.sub1
567 # GCN-NEXT: %1.sub0:vreg_64 = COPY %2.sub0
568 # GCN-NEXT: S_ENDPGM 0
570 name: swap_virt_copy_subreg_impuse_x
572 - { id: 0, class: vreg_64 }
573 - { id: 1, class: vreg_64 }
574 - { id: 2, class: vreg_64 }
579 %2.sub0 = COPY %0.sub0
580 %2.sub1 = COPY %0.sub1
581 %0.sub0 = COPY %1.sub0, implicit %0
582 %0.sub1 = COPY %1.sub1
583 %1.sub0 = COPY %2.sub0
587 # GCN-LABEL: name: swap_exact_max_insns_apart
589 # GCN-NEXT: %0:vgpr_32 = IMPLICIT_DEF
590 # GCN-NEXT: %1:vgpr_32 = IMPLICIT_DEF
591 # GCN-NEXT: %3:vgpr_32 = IMPLICIT_DEF
592 # GCN-NEXT: %4:vgpr_32 = COPY %3
593 # GCN-NEXT: %3:vgpr_32 = COPY %4
594 # GCN-NEXT: %4:vgpr_32 = COPY %3
595 # GCN-NEXT: %3:vgpr_32 = COPY %4
596 # GCN-NEXT: %4:vgpr_32 = COPY %3
597 # GCN-NEXT: %3:vgpr_32 = COPY %4
598 # GCN-NEXT: %4:vgpr_32 = COPY %3
599 # GCN-NEXT: %3:vgpr_32 = COPY %4
600 # GCN-NEXT: %4:vgpr_32 = COPY %3
601 # GCN-NEXT: %3:vgpr_32 = COPY %4
602 # GCN-NEXT: %4:vgpr_32 = COPY %3
603 # GCN-NEXT: %3:vgpr_32 = COPY %4
604 # GCN-NEXT: %4:vgpr_32 = COPY %3
605 # GCN-NEXT: %0:vgpr_32, %1:vgpr_32 = V_SWAP_B32 %1, %0, implicit $exec
606 # GCN-NEXT: S_ENDPGM 0
609 name: swap_exact_max_insns_apart
611 - { id: 0, class: vgpr_32 }
612 - { id: 1, class: vgpr_32 }
613 - { id: 2, class: vgpr_32 }
614 - { id: 3, class: vgpr_32 }
615 - { id: 4, class: vgpr_32 }
640 # GCN-LABEL: name: swap_too_far
642 # GCN-NEXT: %0:vgpr_32 = IMPLICIT_DEF
643 # GCN-NEXT: %1:vgpr_32 = IMPLICIT_DEF
644 # GCN-NEXT: %2:vgpr_32 = COPY %0
645 # GCN-NEXT: %3:vgpr_32 = IMPLICIT_DEF
646 # GCN-NEXT: %4:vgpr_32 = COPY %3
647 # GCN-NEXT: %3:vgpr_32 = COPY %4
648 # GCN-NEXT: %4:vgpr_32 = COPY %3
649 # GCN-NEXT: %3:vgpr_32 = COPY %4
650 # GCN-NEXT: %4:vgpr_32 = COPY %3
651 # GCN-NEXT: %3:vgpr_32 = COPY %4
652 # GCN-NEXT: %4:vgpr_32 = COPY %3
653 # GCN-NEXT: %3:vgpr_32 = COPY %4
654 # GCN-NEXT: %4:vgpr_32 = COPY %3
655 # GCN-NEXT: %3:vgpr_32 = COPY %4
656 # GCN-NEXT: %4:vgpr_32 = COPY %3
657 # GCN-NEXT: %3:vgpr_32 = COPY %4
658 # GCN-NEXT: %4:vgpr_32 = COPY %3
659 # GCN-NEXT: %3:vgpr_32 = COPY %4
660 # GCN-NEXT: %0:vgpr_32 = COPY %1
661 # GCN-NEXT: %1:vgpr_32 = COPY %2
662 # GCN-NEXT: S_ENDPGM 0
667 - { id: 0, class: vgpr_32 }
668 - { id: 1, class: vgpr_32 }
669 - { id: 2, class: vgpr_32 }
670 - { id: 3, class: vgpr_32 }
671 - { id: 4, class: vgpr_32 }
697 # GCN-LABEL: name: swap_liveness_error_mov
698 # GCN: $vgpr6 = V_MOV_B32_e32 $vgpr1, implicit $exec
699 # GCN-NEXT: $vgpr1, $vgpr5 = V_SWAP_B32 $vgpr5, $vgpr1, implicit $exec
700 # GCN-NEXT: $vgpr5_vgpr6 = IMPLICIT_DEF
701 # GCN-NEXT: $vgpr6 = V_MOV_B32_e32 $vgpr7, implicit $exec, implicit $vgpr6_vgpr7
702 # GCN-NEXT: $vgpr5 = V_MOV_B32_e32 $vgpr6, implicit $exec
705 name: swap_liveness_error_mov
706 tracksRegLiveness: true
709 liveins: $vgpr5, $vgpr1_vgpr2
711 $vgpr6 = V_MOV_B32_e32 $vgpr1, implicit $exec, implicit killed $vgpr1_vgpr2
712 $vgpr1 = V_MOV_B32_e32 killed $vgpr5, implicit $exec
713 $vgpr5 = V_MOV_B32_e32 $vgpr6, implicit $exec, implicit-def $vgpr5_vgpr6, implicit $vgpr6_vgpr7
714 $vgpr6 = V_MOV_B32_e32 $vgpr7, implicit $exec, implicit $vgpr6_vgpr7
715 $vgpr5 = V_MOV_B32_e32 $vgpr6, implicit $exec
719 # GCN-LABEL: name: swap_liveness_error_copy
720 # GCN: $vgpr6 = COPY $vgpr1
721 # GCN-NEXT: $vgpr1, $vgpr5 = V_SWAP_B32 $vgpr5, $vgpr1, implicit $exec
722 # GCN-NEXT: $vgpr5_vgpr6 = IMPLICIT_DEF
723 # GCN-NEXT: $vgpr6 = COPY $vgpr7, implicit $vgpr6_vgpr7
724 # GCN-NEXT: $vgpr5 = COPY $vgpr6
727 name: swap_liveness_error_copy
728 tracksRegLiveness: true
731 liveins: $vgpr5, $vgpr1_vgpr2
733 $vgpr6 = COPY $vgpr1, implicit killed $vgpr1_vgpr2
734 $vgpr1 = COPY killed $vgpr5
735 $vgpr5 = COPY $vgpr6, implicit-def $vgpr5_vgpr6, implicit $vgpr6_vgpr7
736 $vgpr6 = COPY $vgpr7, implicit $vgpr6_vgpr7
741 # GCN-LABEL: name: swap_killed_t_early
742 # GCN: $vgpr2 = V_MOV_B32_e32 killed $vgpr0, implicit $exec
743 # GCN-NEXT: $vgpr3 = V_MOV_B32_e32 killed $vgpr4, implicit $exec, implicit killed $vgpr2
744 # GCN-NEXT: $vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
745 # GCN-NEXT: $vgpr5 = V_MOV_B32_e32 killed $vgpr6, implicit $exec
746 # GCN-NEXT: $vgpr1 = V_MOV_B32_e32 undef $vgpr2, implicit $exec
749 name: swap_killed_t_early
752 liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
753 $vgpr2 = V_MOV_B32_e32 killed $vgpr0, implicit $exec
754 $vgpr3 = V_MOV_B32_e32 killed $vgpr4, implicit $exec, implicit killed $vgpr2
755 $vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
756 $vgpr5 = V_MOV_B32_e32 killed $vgpr6, implicit $exec
757 $vgpr1 = V_MOV_B32_e32 undef $vgpr2, implicit $exec
758 S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0, implicit $vgpr1
761 # GCN-LABEL: name: swap_killed_t_late
762 # GCN: $vgpr2 = V_MOV_B32_e32 killed $vgpr0, implicit $exec
763 # GCN-NEXT: $vgpr3 = V_MOV_B32_e32 killed $vgpr4, implicit $exec
764 # GCN-NEXT: $vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
765 # GCN-NEXT: $vgpr5 = V_MOV_B32_e32 killed $vgpr6, implicit $exec, implicit killed $vgpr2
766 # GCN-NEXT: $vgpr1 = V_MOV_B32_e32 undef $vgpr2, implicit $exec
769 name: swap_killed_t_late
772 liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
773 $vgpr2 = V_MOV_B32_e32 killed $vgpr0, implicit $exec
774 $vgpr3 = V_MOV_B32_e32 killed $vgpr4, implicit $exec
775 $vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
776 $vgpr5 = V_MOV_B32_e32 killed $vgpr6, implicit $exec, implicit killed $vgpr2
777 $vgpr1 = V_MOV_B32_e32 undef $vgpr2, implicit $exec
778 S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0, implicit $vgpr1
781 # GCN-LABEL: name: swap_killed_x
782 # GCN: $vgpr2 = V_MOV_B32_e32 killed $vgpr0, implicit $exec
783 # GCN-NEXT: $vgpr3 = V_MOV_B32_e32 killed $vgpr4, implicit $exec
784 # GCN-NEXT: $vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
785 # GCN-NEXT: $vgpr5 = V_MOV_B32_e32 killed $vgpr6, implicit $exec, implicit killed $vgpr0
786 # GCN-NEXT: $vgpr1 = V_MOV_B32_e32 killed $vgpr2, implicit $exec
792 liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
793 $vgpr2 = V_MOV_B32_e32 killed $vgpr0, implicit $exec
794 $vgpr3 = V_MOV_B32_e32 killed $vgpr4, implicit $exec
795 $vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
796 $vgpr5 = V_MOV_B32_e32 killed $vgpr6, implicit $exec, implicit killed $vgpr0
797 $vgpr1 = V_MOV_B32_e32 killed $vgpr2, implicit $exec
798 S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0, implicit $vgpr1
801 # GCN-LABEL: name: indirect_mov_t
802 # GCN: $vgpr2 = V_MOV_B32_e32 killed $vgpr0, implicit $exec, implicit $m0
803 # GCN-NEXT: $vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
804 # GCN-NEXT: $vgpr1 = V_MOV_B32_e32 killed $vgpr2, implicit $exec
805 # GCN-NEXT: S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0, implicit $vgpr1
811 liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
812 $vgpr2 = V_MOV_B32_e32 killed $vgpr0, implicit $exec, implicit $m0
813 $vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
814 $vgpr1 = V_MOV_B32_e32 killed $vgpr2, implicit $exec
815 S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0, implicit $vgpr1
818 # GCN-LABEL: name: indirect_mov_x
819 # GCN: $vgpr2 = V_MOV_B32_e32 killed $vgpr0, implicit $exec
820 # GCN-NEXT: $vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec, implicit $m0
821 # GCN-NEXT: $vgpr1 = V_MOV_B32_e32 killed $vgpr2, implicit $exec
822 # GCN-NEXT: S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0, implicit $vgpr1
828 liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
829 $vgpr2 = V_MOV_B32_e32 killed $vgpr0, implicit $exec
830 $vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec, implicit $m0
831 $vgpr1 = V_MOV_B32_e32 killed $vgpr2, implicit $exec
832 S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0, implicit $vgpr1
835 # GCN-LABEL: name: indirect_mov_y
836 # GCN: $vgpr2 = V_MOV_B32_e32 killed $vgpr0, implicit $exec
837 # GCN-NEXT: $vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
838 # GCN-NEXT: $vgpr1 = V_MOV_B32_e32 killed $vgpr2, implicit $exec, implicit $m0
839 # GCN-NEXT: S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0, implicit $vgpr1
845 liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
846 $vgpr2 = V_MOV_B32_e32 killed $vgpr0, implicit $exec
847 $vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
848 $vgpr1 = V_MOV_B32_e32 killed $vgpr2, implicit $exec, implicit $m0
849 S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0, implicit $vgpr1
852 # GCN-LABEL: name: implicit_ops_mov_x_swap_b32
853 # GCN: $vgpr0, $vgpr1 = V_SWAP_B32 $vgpr1, $vgpr0, implicit $exec, implicit $vgpr2, implicit killed $vgpr1_vgpr2
856 name: implicit_ops_mov_x_swap_b32
859 liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
860 $vgpr3 = V_MOV_B32_e32 killed $vgpr0, implicit $exec
861 $vgpr0 = V_MOV_B32_e32 $vgpr1, implicit $exec, implicit $vgpr2, implicit killed $vgpr1_vgpr2
862 $vgpr1 = V_MOV_B32_e32 killed $vgpr3, implicit $exec
863 S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0, implicit $vgpr1
866 # GCN-LABEL: name: implict_ops_mov_x_swap_b64
867 # GCN: %2:vreg_64 = COPY %0
868 # GCN-NEXT: %0:vreg_64 = COPY %1, implicit $vgpr0
869 # GCN-NEXT: %1:vreg_64 = COPY %2
872 name: implict_ops_mov_x_swap_b64
874 - { id: 0, class: vreg_64 }
875 - { id: 1, class: vreg_64 }
876 - { id: 2, class: vreg_64 }
882 %0 = COPY %1, implicit $vgpr0
886 # GCN-LABEL: implicit_ops_mov_t_swap_b32
887 # GCN: $vgpr3 = V_MOV_B32_e32 $vgpr0, implicit $exec, implicit $vgpr2, implicit killed $vgpr1_vgpr2, implicit-def $vgpr1
888 # GCN-NEXT: $vgpr0, $vgpr1 = V_SWAP_B32 $vgpr1, $vgpr0, implicit $exec
891 name: implicit_ops_mov_t_swap_b32
894 liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
895 $vgpr3 = V_MOV_B32_e32 killed $vgpr0, implicit $exec, implicit $vgpr2, implicit killed $vgpr1_vgpr2, implicit-def $vgpr1
896 $vgpr0 = V_MOV_B32_e32 $vgpr1, implicit $exec
897 $vgpr1 = V_MOV_B32_e32 killed $vgpr3, implicit $exec
898 S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0, implicit $vgpr1
901 # GCN-LABEL: implicit_ops_mov_y_swap_b32
902 # GCN: $vgpr0, $vgpr1 = V_SWAP_B32 $vgpr1, $vgpr0, implicit $exec
903 # GCN-NEXT: $vgpr0_vgpr1 = IMPLICIT_DEF
906 name: implicit_ops_mov_y_swap_b32
909 liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
910 $vgpr3 = V_MOV_B32_e32 killed $vgpr0, implicit $exec
911 $vgpr0 = V_MOV_B32_e32 $vgpr1, implicit $exec
912 $vgpr1 = V_MOV_B32_e32 killed $vgpr3, implicit $exec, implicit $vgpr2, implicit-def $vgpr0_vgpr1, implicit killed $vgpr3
913 S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0, implicit $vgpr1