1 # RUN: llc -march=amdgcn -mcpu=tahiti -verify-machineinstrs -run-pass machine-scheduler -o - %s | FileCheck -check-prefix=GCN %s
3 # GCN-LABEL: name: cluster_add_addc
4 # GCN: S_NOP 0, implicit-def $vcc
5 # GCN: dead %2:vgpr_32, %3:sreg_64_xexec = V_ADD_CO_U32_e64 %0, %1, 0, implicit $exec
6 # GCN: dead %4:vgpr_32, dead %5:sreg_64_xexec = V_ADDC_U32_e64 %6, %7, %3, 0, implicit $exec
9 - { id: 0, class: vgpr_32 }
10 - { id: 1, class: vgpr_32 }
11 - { id: 2, class: vgpr_32 }
12 - { id: 3, class: sreg_64_xexec }
13 - { id: 4, class: vgpr_32 }
14 - { id: 5, class: sreg_64_xexec }
15 - { id: 6, class: vgpr_32 }
16 - { id: 7, class: vgpr_32 }
20 %0 = V_MOV_B32_e32 0, implicit $exec
21 %1 = V_MOV_B32_e32 0, implicit $exec
22 %2, %3 = V_ADD_CO_U32_e64 %0, %1, 0, implicit $exec
23 %6 = V_MOV_B32_e32 0, implicit $exec
24 %7 = V_MOV_B32_e32 0, implicit $exec
25 S_NOP 0, implicit def $vcc
26 %4, %5 = V_ADDC_U32_e64 %6, %7, %3, 0, implicit $exec
29 # GCN-LABEL: name: interleave_add64s
30 # GCN: dead %8:vgpr_32, %9:sreg_64_xexec = V_ADD_CO_U32_e64 %0, %1, 0, implicit $exec
31 # GCN-NEXT: dead %12:vgpr_32, dead %13:sreg_64_xexec = V_ADDC_U32_e64 %4, %5, %9, 0, implicit $exec
32 # GCN-NEXT: dead %10:vgpr_32, %11:sreg_64_xexec = V_ADD_CO_U32_e64 %2, %3, 0, implicit $exec
33 # GCN-NEXT: dead %14:vgpr_32, dead %15:sreg_64_xexec = V_ADDC_U32_e64 %6, %7, %11, 0, implicit $exec
34 name: interleave_add64s
36 - { id: 0, class: vgpr_32 }
37 - { id: 1, class: vgpr_32 }
38 - { id: 2, class: vgpr_32 }
39 - { id: 3, class: vgpr_32 }
40 - { id: 4, class: vgpr_32 }
41 - { id: 5, class: vgpr_32 }
42 - { id: 6, class: vgpr_32 }
43 - { id: 7, class: vgpr_32 }
44 - { id: 8, class: vgpr_32 }
45 - { id: 9, class: sreg_64_xexec }
46 - { id: 10, class: vgpr_32 }
47 - { id: 11, class: sreg_64_xexec }
48 - { id: 12, class: vgpr_32 }
49 - { id: 13, class: sreg_64_xexec }
50 - { id: 14, class: vgpr_32 }
51 - { id: 15, class: sreg_64_xexec }
55 %0 = V_MOV_B32_e32 0, implicit $exec
56 %1 = V_MOV_B32_e32 0, implicit $exec
57 %2 = V_MOV_B32_e32 0, implicit $exec
58 %3 = V_MOV_B32_e32 0, implicit $exec
59 %4 = V_MOV_B32_e32 0, implicit $exec
60 %5 = V_MOV_B32_e32 0, implicit $exec
61 %6 = V_MOV_B32_e32 0, implicit $exec
62 %7 = V_MOV_B32_e32 0, implicit $exec
64 %8, %9 = V_ADD_CO_U32_e64 %0, %1, 0, implicit $exec
65 %10, %11 = V_ADD_CO_U32_e64 %2, %3, 0, implicit $exec
68 %12, %13 = V_ADDC_U32_e64 %4, %5, %9, 0, implicit $exec
69 %14, %15 = V_ADDC_U32_e64 %6, %7, %11, 0, implicit $exec
72 # GCN-LABEL: name: cluster_mov_addc
73 # GCN: S_NOP 0, implicit-def $vcc
74 # GCN-NEXT: %2:sreg_64_xexec = S_MOV_B64 0
75 # GCN-NEXT: dead %3:vgpr_32, dead %4:sreg_64_xexec = V_ADDC_U32_e64 %0, %1, %2, 0, implicit $exec
76 name: cluster_mov_addc
78 - { id: 0, class: vgpr_32 }
79 - { id: 1, class: vgpr_32 }
80 - { id: 2, class: sreg_64_xexec }
81 - { id: 3, class: vgpr_32 }
82 - { id: 4, class: sreg_64_xexec }
83 - { id: 6, class: vgpr_32 }
84 - { id: 7, class: vgpr_32 }
88 %0 = V_MOV_B32_e32 0, implicit $exec
89 %1 = V_MOV_B32_e32 0, implicit $exec
91 S_NOP 0, implicit def $vcc
92 %3, %4 = V_ADDC_U32_e64 %0, %1, %2, 0, implicit $exec
95 # GCN-LABEL: name: no_cluster_add_addc_diff_sgpr
96 # GCN: dead %2:vgpr_32, dead %3:sreg_64_xexec = V_ADD_CO_U32_e64 %0, %1, 0, implicit $exec
97 # GCN-NEXT: %6:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
98 # GCN-NEXT: %7:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
99 # GCN-NEXT: S_NOP 0, implicit-def $vcc
100 # GCN-NEXT: %8:sreg_64_xexec = S_MOV_B64 0
101 # GCN-NEXT: dead %4:vgpr_32, dead %5:sreg_64_xexec = V_ADDC_U32_e64 %6, %7, %8, 0, implicit $exec
102 name: no_cluster_add_addc_diff_sgpr
104 - { id: 0, class: vgpr_32 }
105 - { id: 1, class: vgpr_32 }
106 - { id: 2, class: vgpr_32 }
107 - { id: 3, class: sreg_64_xexec }
108 - { id: 4, class: vgpr_32 }
109 - { id: 5, class: sreg_64_xexec }
110 - { id: 6, class: vgpr_32 }
111 - { id: 7, class: vgpr_32 }
112 - { id: 8, class: sreg_64_xexec }
115 %0 = V_MOV_B32_e32 0, implicit $exec
116 %1 = V_MOV_B32_e32 0, implicit $exec
118 %2, %3 = V_ADD_CO_U32_e64 %0, %1, 0, implicit $exec
119 %6 = V_MOV_B32_e32 0, implicit $exec
120 %7 = V_MOV_B32_e32 0, implicit $exec
121 S_NOP 0, implicit def $vcc
122 %4, %5 = V_ADDC_U32_e64 %6, %7, %8, 0, implicit $exec
124 # GCN-LABEL: name: cluster_sub_subb
125 # GCN: S_NOP 0, implicit-def $vcc
126 # GCN: dead %2:vgpr_32, %3:sreg_64_xexec = V_SUB_CO_U32_e64 %0, %1, 0, implicit $exec
127 # GCN: dead %4:vgpr_32, dead %5:sreg_64_xexec = V_SUBB_U32_e64 %6, %7, %3, 0, implicit $exec
128 name: cluster_sub_subb
130 - { id: 0, class: vgpr_32 }
131 - { id: 1, class: vgpr_32 }
132 - { id: 2, class: vgpr_32 }
133 - { id: 3, class: sreg_64_xexec }
134 - { id: 4, class: vgpr_32 }
135 - { id: 5, class: sreg_64_xexec }
136 - { id: 6, class: vgpr_32 }
137 - { id: 7, class: vgpr_32 }
141 %0 = V_MOV_B32_e32 0, implicit $exec
142 %1 = V_MOV_B32_e32 0, implicit $exec
143 %2, %3 = V_SUB_CO_U32_e64 %0, %1, 0, implicit $exec
144 %6 = V_MOV_B32_e32 0, implicit $exec
145 %7 = V_MOV_B32_e32 0, implicit $exec
146 S_NOP 0, implicit def $vcc
147 %4, %5 = V_SUBB_U32_e64 %6, %7, %3, 0, implicit $exec
150 # GCN-LABEL: name: cluster_subrev_subbrev
151 # GCN: S_NOP 0, implicit-def $vcc
152 # GCN: dead %2:vgpr_32, %3:sreg_64_xexec = V_SUBREV_CO_U32_e64 %0, %1, 0, implicit $exec
153 # GCN: dead %4:vgpr_32, dead %5:sreg_64_xexec = V_SUBBREV_U32_e64 %6, %7, %3, 0, implicit $exec
154 name: cluster_subrev_subbrev
156 - { id: 0, class: vgpr_32 }
157 - { id: 1, class: vgpr_32 }
158 - { id: 2, class: vgpr_32 }
159 - { id: 3, class: sreg_64_xexec }
160 - { id: 4, class: vgpr_32 }
161 - { id: 5, class: sreg_64_xexec }
162 - { id: 6, class: vgpr_32 }
163 - { id: 7, class: vgpr_32 }
167 %0 = V_MOV_B32_e32 0, implicit $exec
168 %1 = V_MOV_B32_e32 0, implicit $exec
169 %2, %3 = V_SUBREV_CO_U32_e64 %0, %1, 0, implicit $exec
170 %6 = V_MOV_B32_e32 0, implicit $exec
171 %7 = V_MOV_B32_e32 0, implicit $exec
172 S_NOP 0, implicit def $vcc
173 %4, %5 = V_SUBBREV_U32_e64 %6, %7, %3, 0, implicit $exec
176 # GCN-LABEL: name: cluster_cmp_cndmask
177 # GCN: S_NOP 0, implicit-def $vcc
178 # GCN-NEXT: %3:sreg_64_xexec = V_CMP_EQ_I32_e64 %0, %1, implicit $exec
179 # GCN-NEXT: dead %4:vgpr_32 = V_CNDMASK_B32_e64 0, %0, 0, %1, %3, implicit $exec
180 name: cluster_cmp_cndmask
182 - { id: 0, class: vgpr_32 }
183 - { id: 1, class: vgpr_32 }
184 - { id: 2, class: vgpr_32 }
185 - { id: 3, class: sreg_64_xexec }
186 - { id: 4, class: vgpr_32 }
187 - { id: 5, class: sreg_64_xexec }
188 - { id: 6, class: vgpr_32 }
189 - { id: 7, class: vgpr_32 }
193 %0 = V_MOV_B32_e32 0, implicit $exec
194 %1 = V_MOV_B32_e32 0, implicit $exec
195 %3 = V_CMP_EQ_I32_e64 %0, %1, implicit $exec
196 S_NOP 0, implicit def $vcc
197 %4 = V_CNDMASK_B32_e64 0, %0, 0, %1, %3, implicit $exec
200 # GCN-LABEL: name: cluster_multi_use_cmp_cndmask
201 # GCN: %4:sreg_64_xexec = V_CMP_EQ_I32_e64 %0, %1, implicit $exec
202 # GCN-NEXT: dead %5:vgpr_32 = V_CNDMASK_B32_e64 0, %2, 0, %1, %4, implicit $exec
203 # GCN-NEXT: dead %6:vgpr_32 = V_CNDMASK_B32_e64 0, %1, 0, %3, %4, implicit $exec
204 name: cluster_multi_use_cmp_cndmask
206 - { id: 0, class: vgpr_32 }
207 - { id: 1, class: vgpr_32 }
208 - { id: 2, class: vgpr_32 }
209 - { id: 3, class: vgpr_32 }
210 - { id: 4, class: sreg_64_xexec }
211 - { id: 5, class: vgpr_32 }
212 - { id: 6, class: vgpr_32 }
213 - { id: 7, class: vgpr_32 }
217 %0 = V_MOV_B32_e32 0, implicit $exec
218 %1 = V_MOV_B32_e32 0, implicit $exec
219 %2 = V_MOV_B32_e32 0, implicit $exec
220 %3 = V_MOV_B32_e32 0, implicit $exec
222 %4 = V_CMP_EQ_I32_e64 %0, %1, implicit $exec
223 S_NOP 0, implicit def $vcc
224 %5 = V_CNDMASK_B32_e64 0, %2, 0, %1, %4, implicit $exec
225 %6 = V_CNDMASK_B32_e64 0, %1, 0, %3, %4, implicit $exec
228 # GCN-LABEL: name: cluster_multi_use_cmp_cndmask2
229 # GCN: %4:sreg_64_xexec = V_CMP_EQ_I32_e64 %0, %1, implicit $exec
230 # GCN-NEXT: dead %5:vgpr_32 = V_CNDMASK_B32_e64 0, %2, 0, %1, %4, implicit $exec
231 # GCN-NEXT: %3:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
232 # GCN-NEXT: dead %6:vgpr_32 = V_CNDMASK_B32_e64 0, %1, 0, %3, %4, implicit $exec
233 name: cluster_multi_use_cmp_cndmask2
235 - { id: 0, class: vgpr_32 }
236 - { id: 1, class: vgpr_32 }
237 - { id: 2, class: vgpr_32 }
238 - { id: 3, class: vgpr_32 }
239 - { id: 4, class: sreg_64_xexec }
240 - { id: 5, class: vgpr_32 }
241 - { id: 6, class: vgpr_32 }
242 - { id: 7, class: vgpr_32 }
246 %0 = V_MOV_B32_e32 0, implicit $exec
247 %1 = V_MOV_B32_e32 0, implicit $exec
248 %4 = V_CMP_EQ_I32_e64 %0, %1, implicit $exec
249 %2 = V_MOV_B32_e32 0, implicit $exec
250 %5 = V_CNDMASK_B32_e64 0, %2, 0, %1, %4, implicit $exec
251 %3 = V_MOV_B32_e32 0, implicit $exec
252 %6 = V_CNDMASK_B32_e64 0, %1, 0, %3, %4, implicit $exec