1 # RUN: llc -march=amdgcn -run-pass simple-register-coalescing -o - %s | FileCheck --check-prefix=GCN %s
3 # See bug http://llvm.org/PR33524 for details of the problem being checked here
4 # This test will provoke a subrange join (see annotations below) during simple register coalescing
5 # Without a fix for PR33524 this causes an unreachable in SubRange Join
7 # GCN-DAG: undef %[[REG0:[0-9]+]].sub0:sgpr_64 = COPY $sgpr5
8 # GCN-DAG: undef %[[REG1:[0-9]+]].sub0:sgpr_64 = COPY $sgpr2
9 # GCN-DAG: %[[REG0]].sub1:sgpr_64 = S_MOV_B32 1
10 # GCN-DAG: %[[REG1]].sub1:sgpr_64 = S_MOV_B32 1
13 define amdgpu_vs void @regcoal-subrange-join(i32 inreg %arg, i32 inreg %arg1, i32 inreg %arg2, i32 inreg %arg3, i32 inreg %arg4, i32 inreg %arg5, i32 %arg6) local_unnamed_addr #0 {
19 name: regcoal-subrange-join
20 tracksRegLiveness: true
22 - { id: 0, class: sreg_64 }
23 - { id: 1, class: vreg_128 }
24 - { id: 2, class: vreg_128 }
25 - { id: 3, class: vreg_128 }
26 - { id: 4, class: sreg_32_xm0 }
27 - { id: 5, class: sreg_32_xm0 }
28 - { id: 6, class: sreg_32_xm0, preferred-register: '%8' }
29 - { id: 7, class: vreg_128 }
30 - { id: 8, class: sreg_32_xm0, preferred-register: '%6' }
31 - { id: 9, class: vreg_128 }
32 - { id: 10, class: sgpr_32 }
33 - { id: 11, class: sgpr_32 }
34 - { id: 12, class: sgpr_32 }
35 - { id: 13, class: sgpr_32 }
36 - { id: 14, class: sgpr_32 }
37 - { id: 15, class: sgpr_32 }
38 - { id: 16, class: vgpr_32 }
39 - { id: 17, class: sreg_32_xm0 }
40 - { id: 18, class: sreg_64 }
41 - { id: 19, class: sreg_32_xm0 }
42 - { id: 20, class: sreg_32_xm0 }
43 - { id: 21, class: sreg_64 }
44 - { id: 22, class: sreg_32_xm0_xexec }
45 - { id: 23, class: sreg_32_xm0 }
46 - { id: 24, class: sreg_64_xexec }
47 - { id: 25, class: sgpr_128 }
48 - { id: 26, class: sreg_64_xexec }
49 - { id: 27, class: sreg_32_xm0_xexec }
50 - { id: 28, class: sreg_32_xm0 }
51 - { id: 29, class: vgpr_32 }
52 - { id: 30, class: vgpr_32 }
53 - { id: 31, class: vgpr_32 }
54 - { id: 32, class: vgpr_32 }
55 - { id: 33, class: vgpr_32 }
56 - { id: 34, class: vgpr_32 }
57 - { id: 35, class: vgpr_32 }
58 - { id: 36, class: vgpr_32 }
59 - { id: 37, class: vgpr_32 }
60 - { id: 38, class: sgpr_128 }
61 - { id: 39, class: sreg_64_xexec }
62 - { id: 40, class: sreg_32_xm0_xexec }
63 - { id: 41, class: sreg_32_xm0 }
64 - { id: 42, class: vgpr_32 }
65 - { id: 43, class: vgpr_32 }
66 - { id: 44, class: vgpr_32 }
67 - { id: 45, class: vgpr_32 }
68 - { id: 46, class: vgpr_32 }
69 - { id: 47, class: vgpr_32 }
70 - { id: 48, class: vgpr_32 }
71 - { id: 49, class: vgpr_32 }
72 - { id: 50, class: vgpr_32 }
73 - { id: 51, class: sgpr_128 }
74 - { id: 52, class: vgpr_32 }
75 - { id: 53, class: vgpr_32 }
76 - { id: 54, class: vgpr_32 }
77 - { id: 55, class: vgpr_32 }
78 - { id: 56, class: vreg_128 }
79 - { id: 57, class: vreg_128 }
80 - { id: 58, class: vreg_128 }
81 - { id: 59, class: sreg_32_xm0 }
82 - { id: 60, class: sreg_32_xm0 }
83 - { id: 61, class: vreg_128 }
85 - { reg: '$sgpr2', virtual-reg: '%12' }
86 - { reg: '$sgpr5', virtual-reg: '%15' }
89 liveins: $sgpr2, $sgpr5
91 %15 = COPY killed $sgpr5
92 %12 = COPY killed $sgpr2
94 undef %18.sub1 = COPY %17
96 %0.sub0 = COPY killed %12
98 %21.sub0 = COPY killed %15
99 %22 = S_LOAD_DWORD_IMM killed %21, 2, 0, 0
100 %23 = S_MOV_B32 491436
101 undef %24.sub0 = COPY killed %22
102 %24.sub1 = COPY killed %23
103 %25 = S_LOAD_DWORDX4_IMM killed %24, 0, 0, 0
105 %26 = S_LOAD_DWORDX2_IMM %0, 2, 0, 0
106 dead %27 = S_LOAD_DWORD_IMM killed %26, 0, 0, 0
107 S_CBRANCH_SCC0 %bb.1, implicit undef $scc
111 %59 = COPY killed %17
115 %30 = V_MOV_B32_e32 1036831949, implicit $exec
116 %31 = V_ADD_F32_e32 %30, %1.sub3, implicit $exec
117 %33 = V_ADD_F32_e32 %30, %1.sub2, implicit $exec
118 %35 = V_ADD_F32_e32 %30, %1.sub1, implicit $exec
119 %37 = V_ADD_F32_e32 killed %30, killed %1.sub0, implicit $exec
120 undef %56.sub0 = COPY killed %37
121 %56.sub1 = COPY killed %35
122 %56.sub2 = COPY killed %33
123 %56.sub3 = COPY killed %31
127 %59 = COPY killed %28
132 %39 = S_LOAD_DWORDX2_IMM killed %0, 6, 0, 0
133 %40 = S_LOAD_DWORD_IMM killed %39, 0, 0, 0
134 %43 = V_MOV_B32_e32 -1102263091, implicit $exec
139 successors: %bb.3, %bb.4
143 %8 = S_ADD_I32 killed %6, 1, implicit-def dead $scc
144 %44 = V_ADD_F32_e32 %43, %7.sub3, implicit $exec
145 %46 = V_ADD_F32_e32 %43, %7.sub2, implicit $exec
146 %48 = V_ADD_F32_e32 %43, %7.sub1, implicit $exec
147 %50 = V_ADD_F32_e32 %43, killed %7.sub0, implicit $exec
148 undef %57.sub0 = COPY killed %50
149 %57.sub1 = COPY killed %48
151 %57.sub3 = COPY killed %44
152 S_CMP_LT_I32 %8, %40, implicit-def $scc
154 %61 = COPY killed %57
155 S_CBRANCH_SCC1 %bb.3, implicit killed $scc
159 EXP 32, undef %53, undef %54, killed %46, undef %55, 0, 0, 15, implicit $exec