1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn -mcpu=gfx908 -run-pass=amdgpu-regbankselect -regbankselect-fast -verify-machineinstrs -o - %s | FileCheck %s
3 # RUN: llc -mtriple=amdgcn -mcpu=gfx908 -run-pass=amdgpu-regbankselect -regbankselect-greedy -verify-machineinstrs -o - %s | FileCheck %s
6 name: build_vector_v2s32_ss
11 liveins: $sgpr0, $sgpr1
12 ; CHECK-LABEL: name: build_vector_v2s32_ss
13 ; CHECK: liveins: $sgpr0, $sgpr1
15 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
16 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
17 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:sgpr(<2 x s32>) = G_BUILD_VECTOR [[COPY]](s32), [[COPY1]](s32)
18 %0:_(s32) = COPY $sgpr0
19 %1:_(s32) = COPY $sgpr1
20 %2:_(<2 x s32>) = G_BUILD_VECTOR %0, %1
24 name: build_vector_v2s32_sv
29 liveins: $sgpr0, $vgpr0
30 ; CHECK-LABEL: name: build_vector_v2s32_sv
31 ; CHECK: liveins: $sgpr0, $vgpr0
33 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
34 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
35 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
36 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:vgpr(<2 x s32>) = G_BUILD_VECTOR [[COPY2]](s32), [[COPY1]](s32)
37 %0:_(s32) = COPY $sgpr0
38 %1:_(s32) = COPY $vgpr0
39 %2:_(<2 x s32>) = G_BUILD_VECTOR %0, %1
43 name: build_vector_v2s32_vs
48 liveins: $vgpr0, $sgpr0
49 ; CHECK-LABEL: name: build_vector_v2s32_vs
50 ; CHECK: liveins: $vgpr0, $sgpr0
52 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
53 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
54 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
55 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:vgpr(<2 x s32>) = G_BUILD_VECTOR [[COPY]](s32), [[COPY2]](s32)
56 %0:_(s32) = COPY $vgpr0
57 %1:_(s32) = COPY $sgpr0
58 %2:_(<2 x s32>) = G_BUILD_VECTOR %0, %1
62 name: build_vector_v2s32_vv
67 liveins: $vgpr0, $vgpr1
68 ; CHECK-LABEL: name: build_vector_v2s32_vv
69 ; CHECK: liveins: $vgpr0, $vgpr1
71 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
72 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
73 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:vgpr(<2 x s32>) = G_BUILD_VECTOR [[COPY]](s32), [[COPY1]](s32)
74 %0:_(s32) = COPY $vgpr0
75 %1:_(s32) = COPY $vgpr1
76 %2:_(<2 x s32>) = G_BUILD_VECTOR %0, %1
80 name: build_vector_v2s32_aa
81 tracksRegLiveness: true
86 liveins: $agpr0, $agpr1
88 ; CHECK-LABEL: name: build_vector_v2s32_aa
89 ; CHECK: liveins: $agpr0, $agpr1
91 ; CHECK-NEXT: [[COPY:%[0-9]+]]:agpr(s32) = COPY $agpr0
92 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:agpr(s32) = COPY $agpr1
93 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:agpr(<2 x s32>) = G_BUILD_VECTOR [[COPY]](s32), [[COPY1]](s32)
94 ; CHECK-NEXT: S_ENDPGM 0, implicit [[BUILD_VECTOR]](<2 x s32>)
95 %0:_(s32) = COPY $agpr0
96 %1:_(s32) = COPY $agpr1
97 %2:_(<2 x s32>) = G_BUILD_VECTOR %0, %1
98 S_ENDPGM 0, implicit %2
102 name: build_vector_v2s32_va
103 tracksRegLiveness: true
108 liveins: $vgpr0, $agpr0
110 ; CHECK-LABEL: name: build_vector_v2s32_va
111 ; CHECK: liveins: $vgpr0, $agpr0
113 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
114 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:agpr(s32) = COPY $agpr0
115 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
116 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:vgpr(<2 x s32>) = G_BUILD_VECTOR [[COPY]](s32), [[COPY2]](s32)
117 ; CHECK-NEXT: S_ENDPGM 0, implicit [[BUILD_VECTOR]](<2 x s32>)
118 %0:_(s32) = COPY $vgpr0
119 %1:_(s32) = COPY $agpr0
120 %2:_(<2 x s32>) = G_BUILD_VECTOR %0, %1
121 S_ENDPGM 0, implicit %2
125 name: build_vector_v2s32_av
126 tracksRegLiveness: true
131 liveins: $vgpr0, $agpr0
133 ; CHECK-LABEL: name: build_vector_v2s32_av
134 ; CHECK: liveins: $vgpr0, $agpr0
136 ; CHECK-NEXT: [[COPY:%[0-9]+]]:agpr(s32) = COPY $agpr0
137 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
138 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
139 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:vgpr(<2 x s32>) = G_BUILD_VECTOR [[COPY2]](s32), [[COPY1]](s32)
140 ; CHECK-NEXT: S_ENDPGM 0, implicit [[BUILD_VECTOR]](<2 x s32>)
141 %0:_(s32) = COPY $agpr0
142 %1:_(s32) = COPY $vgpr0
143 %2:_(<2 x s32>) = G_BUILD_VECTOR %0, %1
144 S_ENDPGM 0, implicit %2
148 name: build_vector_v2s32_sa
149 tracksRegLiveness: true
154 liveins: $sgpr0, $agpr0
156 ; CHECK-LABEL: name: build_vector_v2s32_sa
157 ; CHECK: liveins: $sgpr0, $agpr0
159 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
160 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:agpr(s32) = COPY $agpr0
161 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
162 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
163 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:vgpr(<2 x s32>) = G_BUILD_VECTOR [[COPY2]](s32), [[COPY3]](s32)
164 ; CHECK-NEXT: S_ENDPGM 0, implicit [[BUILD_VECTOR]](<2 x s32>)
165 %0:_(s32) = COPY $sgpr0
166 %1:_(s32) = COPY $agpr0
167 %2:_(<2 x s32>) = G_BUILD_VECTOR %0, %1
168 S_ENDPGM 0, implicit %2
172 name: build_vector_v2s32_as
173 tracksRegLiveness: true
178 liveins: $sgpr0, $agpr0
180 ; CHECK-LABEL: name: build_vector_v2s32_as
181 ; CHECK: liveins: $sgpr0, $agpr0
183 ; CHECK-NEXT: [[COPY:%[0-9]+]]:agpr(s32) = COPY $agpr0
184 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
185 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
186 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
187 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:vgpr(<2 x s32>) = G_BUILD_VECTOR [[COPY2]](s32), [[COPY3]](s32)
188 ; CHECK-NEXT: S_ENDPGM 0, implicit [[BUILD_VECTOR]](<2 x s32>)
189 %0:_(s32) = COPY $agpr0
190 %1:_(s32) = COPY $sgpr0
191 %2:_(<2 x s32>) = G_BUILD_VECTOR %0, %1
192 S_ENDPGM 0, implicit %2
196 name: build_vector_v3s32_aaa
197 tracksRegLiveness: true
202 liveins: $agpr0, $agpr1, $agpr2
204 ; CHECK-LABEL: name: build_vector_v3s32_aaa
205 ; CHECK: liveins: $agpr0, $agpr1, $agpr2
207 ; CHECK-NEXT: [[COPY:%[0-9]+]]:agpr(s32) = COPY $agpr0
208 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:agpr(s32) = COPY $agpr1
209 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:agpr(s32) = COPY $agpr2
210 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:agpr(<3 x s32>) = G_BUILD_VECTOR [[COPY]](s32), [[COPY1]](s32), [[COPY2]](s32)
211 ; CHECK-NEXT: S_ENDPGM 0, implicit [[BUILD_VECTOR]](<3 x s32>)
212 %0:_(s32) = COPY $agpr0
213 %1:_(s32) = COPY $agpr1
214 %2:_(s32) = COPY $agpr2
215 %3:_(<3 x s32>) = G_BUILD_VECTOR %0, %1, %2
216 S_ENDPGM 0, implicit %3
220 name: build_vector_v4s32_aaaa
221 tracksRegLiveness: true
226 liveins: $agpr0, $agpr1, $agpr2
228 ; CHECK-LABEL: name: build_vector_v4s32_aaaa
229 ; CHECK: liveins: $agpr0, $agpr1, $agpr2
231 ; CHECK-NEXT: [[COPY:%[0-9]+]]:agpr(s32) = COPY $agpr0
232 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:agpr(s32) = COPY $agpr1
233 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:agpr(s32) = COPY $agpr2
234 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:agpr(s32) = COPY $agpr2
235 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:agpr(<4 x s32>) = G_BUILD_VECTOR [[COPY]](s32), [[COPY1]](s32), [[COPY2]](s32), [[COPY3]](s32)
236 ; CHECK-NEXT: S_ENDPGM 0, implicit [[BUILD_VECTOR]](<4 x s32>)
237 %0:_(s32) = COPY $agpr0
238 %1:_(s32) = COPY $agpr1
239 %2:_(s32) = COPY $agpr2
240 %3:_(s32) = COPY $agpr2
241 %4:_(<4 x s32>) = G_BUILD_VECTOR %0, %1, %2, %3
242 S_ENDPGM 0, implicit %4
246 name: build_vector_v8s32_aaaaaaaa
247 tracksRegLiveness: true
252 liveins: $agpr0, $agpr1, $agpr2, $agpr3, $agpr4, $agpr5, $agpr6, $agpr7
254 ; CHECK-LABEL: name: build_vector_v8s32_aaaaaaaa
255 ; CHECK: liveins: $agpr0, $agpr1, $agpr2, $agpr3, $agpr4, $agpr5, $agpr6, $agpr7
257 ; CHECK-NEXT: [[COPY:%[0-9]+]]:agpr(s32) = COPY $agpr0
258 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:agpr(s32) = COPY $agpr1
259 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:agpr(s32) = COPY $agpr2
260 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:agpr(s32) = COPY $agpr3
261 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:agpr(s32) = COPY $agpr4
262 ; CHECK-NEXT: [[COPY5:%[0-9]+]]:agpr(s32) = COPY $agpr5
263 ; CHECK-NEXT: [[COPY6:%[0-9]+]]:agpr(s32) = COPY $agpr6
264 ; CHECK-NEXT: [[COPY7:%[0-9]+]]:agpr(s32) = COPY $agpr7
265 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:agpr(<8 x s32>) = G_BUILD_VECTOR [[COPY]](s32), [[COPY1]](s32), [[COPY2]](s32), [[COPY3]](s32), [[COPY4]](s32), [[COPY5]](s32), [[COPY6]](s32), [[COPY7]](s32)
266 ; CHECK-NEXT: S_ENDPGM 0, implicit [[BUILD_VECTOR]](<8 x s32>)
267 %0:_(s32) = COPY $agpr0
268 %1:_(s32) = COPY $agpr1
269 %2:_(s32) = COPY $agpr2
270 %3:_(s32) = COPY $agpr3
271 %4:_(s32) = COPY $agpr4
272 %5:_(s32) = COPY $agpr5
273 %6:_(s32) = COPY $agpr6
274 %7:_(s32) = COPY $agpr7
275 %8:_(<8 x s32>) = G_BUILD_VECTOR %0, %1, %2, %3, %4, %5, %6, %7
276 S_ENDPGM 0, implicit %8
280 name: build_vector_v16s32_aaaaaaaaaaaaaaaa
281 tracksRegLiveness: true
286 liveins: $agpr0, $agpr1, $agpr2, $agpr3, $agpr4, $agpr5, $agpr6, $agpr7, $agpr8, $agpr9, $agpr10, $agpr11, $agpr12, $agpr13, $agpr14, $agpr15
288 ; CHECK-LABEL: name: build_vector_v16s32_aaaaaaaaaaaaaaaa
289 ; CHECK: liveins: $agpr0, $agpr1, $agpr2, $agpr3, $agpr4, $agpr5, $agpr6, $agpr7, $agpr8, $agpr9, $agpr10, $agpr11, $agpr12, $agpr13, $agpr14, $agpr15
291 ; CHECK-NEXT: [[COPY:%[0-9]+]]:agpr(s32) = COPY $agpr0
292 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:agpr(s32) = COPY $agpr1
293 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:agpr(s32) = COPY $agpr2
294 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:agpr(s32) = COPY $agpr3
295 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:agpr(s32) = COPY $agpr4
296 ; CHECK-NEXT: [[COPY5:%[0-9]+]]:agpr(s32) = COPY $agpr5
297 ; CHECK-NEXT: [[COPY6:%[0-9]+]]:agpr(s32) = COPY $agpr6
298 ; CHECK-NEXT: [[COPY7:%[0-9]+]]:agpr(s32) = COPY $agpr7
299 ; CHECK-NEXT: [[COPY8:%[0-9]+]]:agpr(s32) = COPY $agpr8
300 ; CHECK-NEXT: [[COPY9:%[0-9]+]]:agpr(s32) = COPY $agpr9
301 ; CHECK-NEXT: [[COPY10:%[0-9]+]]:agpr(s32) = COPY $agpr10
302 ; CHECK-NEXT: [[COPY11:%[0-9]+]]:agpr(s32) = COPY $agpr11
303 ; CHECK-NEXT: [[COPY12:%[0-9]+]]:agpr(s32) = COPY $agpr12
304 ; CHECK-NEXT: [[COPY13:%[0-9]+]]:agpr(s32) = COPY $agpr13
305 ; CHECK-NEXT: [[COPY14:%[0-9]+]]:agpr(s32) = COPY $agpr14
306 ; CHECK-NEXT: [[COPY15:%[0-9]+]]:agpr(s32) = COPY $agpr15
307 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:agpr(<16 x s32>) = G_BUILD_VECTOR [[COPY]](s32), [[COPY1]](s32), [[COPY2]](s32), [[COPY3]](s32), [[COPY4]](s32), [[COPY5]](s32), [[COPY6]](s32), [[COPY7]](s32), [[COPY8]](s32), [[COPY9]](s32), [[COPY10]](s32), [[COPY11]](s32), [[COPY12]](s32), [[COPY13]](s32), [[COPY14]](s32), [[COPY15]](s32)
308 ; CHECK-NEXT: S_ENDPGM 0, implicit [[BUILD_VECTOR]](<16 x s32>)
309 %0:_(s32) = COPY $agpr0
310 %1:_(s32) = COPY $agpr1
311 %2:_(s32) = COPY $agpr2
312 %3:_(s32) = COPY $agpr3
313 %4:_(s32) = COPY $agpr4
314 %5:_(s32) = COPY $agpr5
315 %6:_(s32) = COPY $agpr6
316 %7:_(s32) = COPY $agpr7
317 %8:_(s32) = COPY $agpr8
318 %9:_(s32) = COPY $agpr9
319 %10:_(s32) = COPY $agpr10
320 %11:_(s32) = COPY $agpr11
321 %12:_(s32) = COPY $agpr12
322 %13:_(s32) = COPY $agpr13
323 %14:_(s32) = COPY $agpr14
324 %15:_(s32) = COPY $agpr15
325 %16:_(<16 x s32>) = G_BUILD_VECTOR %0, %1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12, %13, %14, %15
326 S_ENDPGM 0, implicit %16