1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=hawaii -O0 -run-pass=legalizer %s -o - | FileCheck -check-prefix=GFX78 %s
3# RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=fiji -O0 -run-pass=legalizer %s -o - | FileCheck -check-prefix=GFX78 %s
4# RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -O0 -run-pass=legalizer %s -o - | FileCheck -check-prefix=GFX9 %s
5
6---
7name: build_vector_v2s16
8body: |
9  bb.0:
10    liveins: $vgpr0, $vgpr1
11
12    ; GFX78-LABEL: name: build_vector_v2s16
13    ; GFX78: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
14    ; GFX78: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
15    ; GFX78: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
16    ; GFX78: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
17    ; GFX78: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
18    ; GFX78: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
19    ; GFX78: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C]]
20    ; GFX78: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
21    ; GFX78: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32)
22    ; GFX78: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]]
23    ; GFX78: [[BITCAST:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR]](s32)
24    ; GFX78: S_NOP 0, implicit [[BITCAST]](<2 x s16>)
25    ; GFX9-LABEL: name: build_vector_v2s16
26    ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
27    ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
28    ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
29    ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
30    ; GFX9: [[BUILD_VECTOR_TRUNC:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY2]](s32), [[COPY3]](s32)
31    ; GFX9: S_NOP 0, implicit [[BUILD_VECTOR_TRUNC]](<2 x s16>)
32    %0:_(s32) = COPY $vgpr0
33    %1:_(s32) = COPY $vgpr1
34    %2:_(s16) = G_TRUNC %0
35    %3:_(s16) = G_TRUNC %1
36    %4:_(<2 x s16>) = G_BUILD_VECTOR %2, %3
37    S_NOP 0, implicit %4
38...
39
40---
41name: build_vector_v3s16
42body: |
43  bb.0:
44    liveins: $vgpr0, $vgpr1, $vgpr2
45
46    ; GFX78-LABEL: name: build_vector_v3s16
47    ; GFX78: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
48    ; GFX78: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
49    ; GFX78: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
50    ; GFX78: [[DEF:%[0-9]+]]:_(s16) = G_IMPLICIT_DEF
51    ; GFX78: [[DEF1:%[0-9]+]]:_(<2 x s16>) = G_IMPLICIT_DEF
52    ; GFX78: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
53    ; GFX78: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
54    ; GFX78: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C]]
55    ; GFX78: [[COPY4:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
56    ; GFX78: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C]]
57    ; GFX78: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
58    ; GFX78: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32)
59    ; GFX78: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]]
60    ; GFX78: [[BITCAST:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR]](s32)
61    ; GFX78: [[COPY5:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
62    ; GFX78: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY5]], [[C]]
63    ; GFX78: [[COPY6:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
64    ; GFX78: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY6]], [[C]]
65    ; GFX78: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C1]](s32)
66    ; GFX78: [[OR1:%[0-9]+]]:_(s32) = G_OR [[AND2]], [[SHL1]]
67    ; GFX78: [[BITCAST1:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR1]](s32)
68    ; GFX78: [[COPY7:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
69    ; GFX78: [[AND4:%[0-9]+]]:_(s32) = G_AND [[COPY7]], [[C]]
70    ; GFX78: [[COPY8:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
71    ; GFX78: [[AND5:%[0-9]+]]:_(s32) = G_AND [[COPY8]], [[C]]
72    ; GFX78: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[AND5]], [[C1]](s32)
73    ; GFX78: [[OR2:%[0-9]+]]:_(s32) = G_OR [[AND4]], [[SHL2]]
74    ; GFX78: [[BITCAST2:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR2]](s32)
75    ; GFX78: [[CONCAT_VECTORS:%[0-9]+]]:_(<6 x s16>) = G_CONCAT_VECTORS [[BITCAST]](<2 x s16>), [[BITCAST1]](<2 x s16>), [[BITCAST2]](<2 x s16>)
76    ; GFX78: S_NOP 0, implicit [[CONCAT_VECTORS]](<6 x s16>)
77    ; GFX9-LABEL: name: build_vector_v3s16
78    ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
79    ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
80    ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
81    ; GFX9: [[DEF:%[0-9]+]]:_(s16) = G_IMPLICIT_DEF
82    ; GFX9: [[DEF1:%[0-9]+]]:_(<2 x s16>) = G_IMPLICIT_DEF
83    ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
84    ; GFX9: [[COPY4:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
85    ; GFX9: [[BUILD_VECTOR_TRUNC:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY3]](s32), [[COPY4]](s32)
86    ; GFX9: [[COPY5:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
87    ; GFX9: [[COPY6:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
88    ; GFX9: [[BUILD_VECTOR_TRUNC1:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY5]](s32), [[COPY6]](s32)
89    ; GFX9: [[COPY7:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
90    ; GFX9: [[COPY8:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
91    ; GFX9: [[BUILD_VECTOR_TRUNC2:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY7]](s32), [[COPY8]](s32)
92    ; GFX9: [[CONCAT_VECTORS:%[0-9]+]]:_(<6 x s16>) = G_CONCAT_VECTORS [[BUILD_VECTOR_TRUNC]](<2 x s16>), [[BUILD_VECTOR_TRUNC1]](<2 x s16>), [[BUILD_VECTOR_TRUNC2]](<2 x s16>)
93    ; GFX9: S_NOP 0, implicit [[CONCAT_VECTORS]](<6 x s16>)
94    %0:_(s32) = COPY $vgpr0
95    %1:_(s32) = COPY $vgpr1
96    %2:_(s32) = COPY $vgpr2
97    %3:_(s16) = G_TRUNC %0
98    %4:_(s16) = G_TRUNC %1
99    %5:_(s16) = G_TRUNC %2
100    %6:_(<3 x s16>) = G_BUILD_VECTOR %3, %4, %5
101    %7:_(<6 x s16>) = G_CONCAT_VECTORS %6, %6
102    S_NOP 0, implicit %7
103...
104
105---
106name: build_vector_v4s16
107body: |
108  bb.0:
109    liveins: $vgpr0, $vgpr1, $vgpr2, $vgpr3
110
111    ; GFX78-LABEL: name: build_vector_v4s16
112    ; GFX78: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
113    ; GFX78: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
114    ; GFX78: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
115    ; GFX78: [[COPY3:%[0-9]+]]:_(s32) = COPY $vgpr3
116    ; GFX78: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
117    ; GFX78: [[COPY4:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
118    ; GFX78: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C]]
119    ; GFX78: [[COPY5:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
120    ; GFX78: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY5]], [[C]]
121    ; GFX78: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
122    ; GFX78: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32)
123    ; GFX78: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]]
124    ; GFX78: [[BITCAST:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR]](s32)
125    ; GFX78: [[COPY6:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
126    ; GFX78: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY6]], [[C]]
127    ; GFX78: [[COPY7:%[0-9]+]]:_(s32) = COPY [[COPY3]](s32)
128    ; GFX78: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY7]], [[C]]
129    ; GFX78: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C1]](s32)
130    ; GFX78: [[OR1:%[0-9]+]]:_(s32) = G_OR [[AND2]], [[SHL1]]
131    ; GFX78: [[BITCAST1:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR1]](s32)
132    ; GFX78: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s16>) = G_CONCAT_VECTORS [[BITCAST]](<2 x s16>), [[BITCAST1]](<2 x s16>)
133    ; GFX78: S_NOP 0, implicit [[CONCAT_VECTORS]](<4 x s16>)
134    ; GFX9-LABEL: name: build_vector_v4s16
135    ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
136    ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
137    ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
138    ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY $vgpr3
139    ; GFX9: [[COPY4:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
140    ; GFX9: [[COPY5:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
141    ; GFX9: [[BUILD_VECTOR_TRUNC:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY4]](s32), [[COPY5]](s32)
142    ; GFX9: [[COPY6:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
143    ; GFX9: [[COPY7:%[0-9]+]]:_(s32) = COPY [[COPY3]](s32)
144    ; GFX9: [[BUILD_VECTOR_TRUNC1:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY6]](s32), [[COPY7]](s32)
145    ; GFX9: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s16>) = G_CONCAT_VECTORS [[BUILD_VECTOR_TRUNC]](<2 x s16>), [[BUILD_VECTOR_TRUNC1]](<2 x s16>)
146    ; GFX9: S_NOP 0, implicit [[CONCAT_VECTORS]](<4 x s16>)
147    %0:_(s32) = COPY $vgpr0
148    %1:_(s32) = COPY $vgpr1
149    %2:_(s32) = COPY $vgpr2
150    %3:_(s32) = COPY $vgpr3
151    %4:_(s16) = G_TRUNC %0
152    %5:_(s16) = G_TRUNC %1
153    %6:_(s16) = G_TRUNC %2
154    %7:_(s16) = G_TRUNC %3
155    %8:_(<4 x s16>) = G_BUILD_VECTOR %4, %5, %6, %7
156    S_NOP 0, implicit %8
157...
158
159---
160name: build_vector_v5s16
161body: |
162  bb.0:
163    liveins: $vgpr0, $vgpr1, $vgpr2, $vgpr3, $vgpr4
164
165    ; GFX78-LABEL: name: build_vector_v5s16
166    ; GFX78: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
167    ; GFX78: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
168    ; GFX78: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
169    ; GFX78: [[COPY3:%[0-9]+]]:_(s32) = COPY $vgpr3
170    ; GFX78: [[COPY4:%[0-9]+]]:_(s32) = COPY $vgpr4
171    ; GFX78: [[DEF:%[0-9]+]]:_(s16) = G_IMPLICIT_DEF
172    ; GFX78: [[DEF1:%[0-9]+]]:_(<2 x s16>) = G_IMPLICIT_DEF
173    ; GFX78: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
174    ; GFX78: [[COPY5:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
175    ; GFX78: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY5]], [[C]]
176    ; GFX78: [[COPY6:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
177    ; GFX78: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY6]], [[C]]
178    ; GFX78: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
179    ; GFX78: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32)
180    ; GFX78: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]]
181    ; GFX78: [[BITCAST:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR]](s32)
182    ; GFX78: [[COPY7:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
183    ; GFX78: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY7]], [[C]]
184    ; GFX78: [[COPY8:%[0-9]+]]:_(s32) = COPY [[COPY3]](s32)
185    ; GFX78: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY8]], [[C]]
186    ; GFX78: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C1]](s32)
187    ; GFX78: [[OR1:%[0-9]+]]:_(s32) = G_OR [[AND2]], [[SHL1]]
188    ; GFX78: [[BITCAST1:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR1]](s32)
189    ; GFX78: [[COPY9:%[0-9]+]]:_(s32) = COPY [[COPY4]](s32)
190    ; GFX78: [[AND4:%[0-9]+]]:_(s32) = G_AND [[COPY9]], [[C]]
191    ; GFX78: [[COPY10:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
192    ; GFX78: [[AND5:%[0-9]+]]:_(s32) = G_AND [[COPY10]], [[C]]
193    ; GFX78: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[AND5]], [[C1]](s32)
194    ; GFX78: [[OR2:%[0-9]+]]:_(s32) = G_OR [[AND4]], [[SHL2]]
195    ; GFX78: [[BITCAST2:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR2]](s32)
196    ; GFX78: [[COPY11:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
197    ; GFX78: [[AND6:%[0-9]+]]:_(s32) = G_AND [[COPY11]], [[C]]
198    ; GFX78: [[COPY12:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
199    ; GFX78: [[AND7:%[0-9]+]]:_(s32) = G_AND [[COPY12]], [[C]]
200    ; GFX78: [[SHL3:%[0-9]+]]:_(s32) = G_SHL [[AND7]], [[C1]](s32)
201    ; GFX78: [[OR3:%[0-9]+]]:_(s32) = G_OR [[AND6]], [[SHL3]]
202    ; GFX78: [[BITCAST3:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR3]](s32)
203    ; GFX78: [[COPY13:%[0-9]+]]:_(s32) = COPY [[COPY3]](s32)
204    ; GFX78: [[AND8:%[0-9]+]]:_(s32) = G_AND [[COPY13]], [[C]]
205    ; GFX78: [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY4]](s32)
206    ; GFX78: [[AND9:%[0-9]+]]:_(s32) = G_AND [[COPY14]], [[C]]
207    ; GFX78: [[SHL4:%[0-9]+]]:_(s32) = G_SHL [[AND9]], [[C1]](s32)
208    ; GFX78: [[OR4:%[0-9]+]]:_(s32) = G_OR [[AND8]], [[SHL4]]
209    ; GFX78: [[BITCAST4:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR4]](s32)
210    ; GFX78: [[CONCAT_VECTORS:%[0-9]+]]:_(<10 x s16>) = G_CONCAT_VECTORS [[BITCAST]](<2 x s16>), [[BITCAST1]](<2 x s16>), [[BITCAST2]](<2 x s16>), [[BITCAST3]](<2 x s16>), [[BITCAST4]](<2 x s16>)
211    ; GFX78: S_NOP 0, implicit [[CONCAT_VECTORS]](<10 x s16>)
212    ; GFX9-LABEL: name: build_vector_v5s16
213    ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
214    ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
215    ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
216    ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY $vgpr3
217    ; GFX9: [[COPY4:%[0-9]+]]:_(s32) = COPY $vgpr4
218    ; GFX9: [[DEF:%[0-9]+]]:_(s16) = G_IMPLICIT_DEF
219    ; GFX9: [[DEF1:%[0-9]+]]:_(<2 x s16>) = G_IMPLICIT_DEF
220    ; GFX9: [[COPY5:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
221    ; GFX9: [[COPY6:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
222    ; GFX9: [[BUILD_VECTOR_TRUNC:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY5]](s32), [[COPY6]](s32)
223    ; GFX9: [[COPY7:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
224    ; GFX9: [[COPY8:%[0-9]+]]:_(s32) = COPY [[COPY3]](s32)
225    ; GFX9: [[BUILD_VECTOR_TRUNC1:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY7]](s32), [[COPY8]](s32)
226    ; GFX9: [[COPY9:%[0-9]+]]:_(s32) = COPY [[COPY4]](s32)
227    ; GFX9: [[COPY10:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
228    ; GFX9: [[BUILD_VECTOR_TRUNC2:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY9]](s32), [[COPY10]](s32)
229    ; GFX9: [[COPY11:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
230    ; GFX9: [[COPY12:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
231    ; GFX9: [[BUILD_VECTOR_TRUNC3:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY11]](s32), [[COPY12]](s32)
232    ; GFX9: [[COPY13:%[0-9]+]]:_(s32) = COPY [[COPY3]](s32)
233    ; GFX9: [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY4]](s32)
234    ; GFX9: [[BUILD_VECTOR_TRUNC4:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY13]](s32), [[COPY14]](s32)
235    ; GFX9: [[CONCAT_VECTORS:%[0-9]+]]:_(<10 x s16>) = G_CONCAT_VECTORS [[BUILD_VECTOR_TRUNC]](<2 x s16>), [[BUILD_VECTOR_TRUNC1]](<2 x s16>), [[BUILD_VECTOR_TRUNC2]](<2 x s16>), [[BUILD_VECTOR_TRUNC3]](<2 x s16>), [[BUILD_VECTOR_TRUNC4]](<2 x s16>)
236    ; GFX9: S_NOP 0, implicit [[CONCAT_VECTORS]](<10 x s16>)
237    %0:_(s32) = COPY $vgpr0
238    %1:_(s32) = COPY $vgpr1
239    %2:_(s32) = COPY $vgpr2
240    %3:_(s32) = COPY $vgpr3
241    %4:_(s32) = COPY $vgpr4
242    %5:_(s16) = G_TRUNC %0
243    %6:_(s16) = G_TRUNC %1
244    %7:_(s16) = G_TRUNC %2
245    %8:_(s16) = G_TRUNC %3
246    %9:_(s16) = G_TRUNC %4
247    %10:_(<5 x s16>) = G_BUILD_VECTOR %5, %6, %7, %8, %9
248    %11:_(<10 x s16>) = G_CONCAT_VECTORS %10, %10
249    S_NOP 0, implicit %11
250...
251
252---
253name: build_vector_v7s16
254body: |
255  bb.0:
256    liveins: $vgpr0, $vgpr1, $vgpr2, $vgpr3, $vgpr4, $vgpr5, $vgpr6
257
258    ; GFX78-LABEL: name: build_vector_v7s16
259    ; GFX78: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
260    ; GFX78: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
261    ; GFX78: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
262    ; GFX78: [[COPY3:%[0-9]+]]:_(s32) = COPY $vgpr3
263    ; GFX78: [[COPY4:%[0-9]+]]:_(s32) = COPY $vgpr4
264    ; GFX78: [[COPY5:%[0-9]+]]:_(s32) = COPY $vgpr5
265    ; GFX78: [[COPY6:%[0-9]+]]:_(s32) = COPY $vgpr6
266    ; GFX78: [[DEF:%[0-9]+]]:_(s16) = G_IMPLICIT_DEF
267    ; GFX78: [[DEF1:%[0-9]+]]:_(<2 x s16>) = G_IMPLICIT_DEF
268    ; GFX78: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
269    ; GFX78: [[COPY7:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
270    ; GFX78: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY7]], [[C]]
271    ; GFX78: [[COPY8:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
272    ; GFX78: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY8]], [[C]]
273    ; GFX78: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
274    ; GFX78: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32)
275    ; GFX78: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]]
276    ; GFX78: [[BITCAST:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR]](s32)
277    ; GFX78: [[COPY9:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
278    ; GFX78: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY9]], [[C]]
279    ; GFX78: [[COPY10:%[0-9]+]]:_(s32) = COPY [[COPY3]](s32)
280    ; GFX78: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY10]], [[C]]
281    ; GFX78: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C1]](s32)
282    ; GFX78: [[OR1:%[0-9]+]]:_(s32) = G_OR [[AND2]], [[SHL1]]
283    ; GFX78: [[BITCAST1:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR1]](s32)
284    ; GFX78: [[COPY11:%[0-9]+]]:_(s32) = COPY [[COPY4]](s32)
285    ; GFX78: [[AND4:%[0-9]+]]:_(s32) = G_AND [[COPY11]], [[C]]
286    ; GFX78: [[COPY12:%[0-9]+]]:_(s32) = COPY [[COPY5]](s32)
287    ; GFX78: [[AND5:%[0-9]+]]:_(s32) = G_AND [[COPY12]], [[C]]
288    ; GFX78: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[AND5]], [[C1]](s32)
289    ; GFX78: [[OR2:%[0-9]+]]:_(s32) = G_OR [[AND4]], [[SHL2]]
290    ; GFX78: [[BITCAST2:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR2]](s32)
291    ; GFX78: [[COPY13:%[0-9]+]]:_(s32) = COPY [[COPY6]](s32)
292    ; GFX78: [[AND6:%[0-9]+]]:_(s32) = G_AND [[COPY13]], [[C]]
293    ; GFX78: [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
294    ; GFX78: [[AND7:%[0-9]+]]:_(s32) = G_AND [[COPY14]], [[C]]
295    ; GFX78: [[SHL3:%[0-9]+]]:_(s32) = G_SHL [[AND7]], [[C1]](s32)
296    ; GFX78: [[OR3:%[0-9]+]]:_(s32) = G_OR [[AND6]], [[SHL3]]
297    ; GFX78: [[BITCAST3:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR3]](s32)
298    ; GFX78: [[COPY15:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
299    ; GFX78: [[AND8:%[0-9]+]]:_(s32) = G_AND [[COPY15]], [[C]]
300    ; GFX78: [[COPY16:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
301    ; GFX78: [[AND9:%[0-9]+]]:_(s32) = G_AND [[COPY16]], [[C]]
302    ; GFX78: [[SHL4:%[0-9]+]]:_(s32) = G_SHL [[AND9]], [[C1]](s32)
303    ; GFX78: [[OR4:%[0-9]+]]:_(s32) = G_OR [[AND8]], [[SHL4]]
304    ; GFX78: [[BITCAST4:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR4]](s32)
305    ; GFX78: [[COPY17:%[0-9]+]]:_(s32) = COPY [[COPY3]](s32)
306    ; GFX78: [[AND10:%[0-9]+]]:_(s32) = G_AND [[COPY17]], [[C]]
307    ; GFX78: [[COPY18:%[0-9]+]]:_(s32) = COPY [[COPY4]](s32)
308    ; GFX78: [[AND11:%[0-9]+]]:_(s32) = G_AND [[COPY18]], [[C]]
309    ; GFX78: [[SHL5:%[0-9]+]]:_(s32) = G_SHL [[AND11]], [[C1]](s32)
310    ; GFX78: [[OR5:%[0-9]+]]:_(s32) = G_OR [[AND10]], [[SHL5]]
311    ; GFX78: [[BITCAST5:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR5]](s32)
312    ; GFX78: [[COPY19:%[0-9]+]]:_(s32) = COPY [[COPY5]](s32)
313    ; GFX78: [[AND12:%[0-9]+]]:_(s32) = G_AND [[COPY19]], [[C]]
314    ; GFX78: [[COPY20:%[0-9]+]]:_(s32) = COPY [[COPY6]](s32)
315    ; GFX78: [[AND13:%[0-9]+]]:_(s32) = G_AND [[COPY20]], [[C]]
316    ; GFX78: [[SHL6:%[0-9]+]]:_(s32) = G_SHL [[AND13]], [[C1]](s32)
317    ; GFX78: [[OR6:%[0-9]+]]:_(s32) = G_OR [[AND12]], [[SHL6]]
318    ; GFX78: [[BITCAST6:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR6]](s32)
319    ; GFX78: [[CONCAT_VECTORS:%[0-9]+]]:_(<14 x s16>) = G_CONCAT_VECTORS [[BITCAST]](<2 x s16>), [[BITCAST1]](<2 x s16>), [[BITCAST2]](<2 x s16>), [[BITCAST3]](<2 x s16>), [[BITCAST4]](<2 x s16>), [[BITCAST5]](<2 x s16>), [[BITCAST6]](<2 x s16>)
320    ; GFX78: S_NOP 0, implicit [[CONCAT_VECTORS]](<14 x s16>)
321    ; GFX9-LABEL: name: build_vector_v7s16
322    ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
323    ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
324    ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
325    ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY $vgpr3
326    ; GFX9: [[COPY4:%[0-9]+]]:_(s32) = COPY $vgpr4
327    ; GFX9: [[COPY5:%[0-9]+]]:_(s32) = COPY $vgpr5
328    ; GFX9: [[COPY6:%[0-9]+]]:_(s32) = COPY $vgpr6
329    ; GFX9: [[DEF:%[0-9]+]]:_(s16) = G_IMPLICIT_DEF
330    ; GFX9: [[DEF1:%[0-9]+]]:_(<2 x s16>) = G_IMPLICIT_DEF
331    ; GFX9: [[COPY7:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
332    ; GFX9: [[COPY8:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
333    ; GFX9: [[BUILD_VECTOR_TRUNC:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY7]](s32), [[COPY8]](s32)
334    ; GFX9: [[COPY9:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
335    ; GFX9: [[COPY10:%[0-9]+]]:_(s32) = COPY [[COPY3]](s32)
336    ; GFX9: [[BUILD_VECTOR_TRUNC1:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY9]](s32), [[COPY10]](s32)
337    ; GFX9: [[COPY11:%[0-9]+]]:_(s32) = COPY [[COPY4]](s32)
338    ; GFX9: [[COPY12:%[0-9]+]]:_(s32) = COPY [[COPY5]](s32)
339    ; GFX9: [[BUILD_VECTOR_TRUNC2:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY11]](s32), [[COPY12]](s32)
340    ; GFX9: [[COPY13:%[0-9]+]]:_(s32) = COPY [[COPY6]](s32)
341    ; GFX9: [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
342    ; GFX9: [[BUILD_VECTOR_TRUNC3:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY13]](s32), [[COPY14]](s32)
343    ; GFX9: [[COPY15:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
344    ; GFX9: [[COPY16:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
345    ; GFX9: [[BUILD_VECTOR_TRUNC4:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY15]](s32), [[COPY16]](s32)
346    ; GFX9: [[COPY17:%[0-9]+]]:_(s32) = COPY [[COPY3]](s32)
347    ; GFX9: [[COPY18:%[0-9]+]]:_(s32) = COPY [[COPY4]](s32)
348    ; GFX9: [[BUILD_VECTOR_TRUNC5:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY17]](s32), [[COPY18]](s32)
349    ; GFX9: [[COPY19:%[0-9]+]]:_(s32) = COPY [[COPY5]](s32)
350    ; GFX9: [[COPY20:%[0-9]+]]:_(s32) = COPY [[COPY6]](s32)
351    ; GFX9: [[BUILD_VECTOR_TRUNC6:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY19]](s32), [[COPY20]](s32)
352    ; GFX9: [[CONCAT_VECTORS:%[0-9]+]]:_(<14 x s16>) = G_CONCAT_VECTORS [[BUILD_VECTOR_TRUNC]](<2 x s16>), [[BUILD_VECTOR_TRUNC1]](<2 x s16>), [[BUILD_VECTOR_TRUNC2]](<2 x s16>), [[BUILD_VECTOR_TRUNC3]](<2 x s16>), [[BUILD_VECTOR_TRUNC4]](<2 x s16>), [[BUILD_VECTOR_TRUNC5]](<2 x s16>), [[BUILD_VECTOR_TRUNC6]](<2 x s16>)
353    ; GFX9: S_NOP 0, implicit [[CONCAT_VECTORS]](<14 x s16>)
354    %0:_(s32) = COPY $vgpr0
355    %1:_(s32) = COPY $vgpr1
356    %2:_(s32) = COPY $vgpr2
357    %3:_(s32) = COPY $vgpr3
358    %4:_(s32) = COPY $vgpr4
359    %5:_(s32) = COPY $vgpr5
360    %6:_(s32) = COPY $vgpr6
361    %7:_(s16) = G_TRUNC %0
362    %8:_(s16) = G_TRUNC %1
363    %9:_(s16) = G_TRUNC %2
364    %10:_(s16) = G_TRUNC %3
365    %11:_(s16) = G_TRUNC %4
366    %12:_(s16) = G_TRUNC %5
367    %13:_(s16) = G_TRUNC %6
368    %14:_(<7 x s16>) = G_BUILD_VECTOR %7, %8, %9, %10, %11, %12, %13
369    %15:_(<14 x s16>) = G_CONCAT_VECTORS %14, %14
370    S_NOP 0, implicit %15
371...
372
373---
374name: build_vector_v8s16
375body: |
376  bb.0:
377    liveins: $vgpr0, $vgpr1, $vgpr2, $vgpr3, $vgpr4, $vgpr5, $vgpr6, $vgpr7
378
379    ; GFX78-LABEL: name: build_vector_v8s16
380    ; GFX78: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
381    ; GFX78: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
382    ; GFX78: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
383    ; GFX78: [[COPY3:%[0-9]+]]:_(s32) = COPY $vgpr3
384    ; GFX78: [[COPY4:%[0-9]+]]:_(s32) = COPY $vgpr4
385    ; GFX78: [[COPY5:%[0-9]+]]:_(s32) = COPY $vgpr5
386    ; GFX78: [[COPY6:%[0-9]+]]:_(s32) = COPY $vgpr6
387    ; GFX78: [[COPY7:%[0-9]+]]:_(s32) = COPY $vgpr7
388    ; GFX78: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
389    ; GFX78: [[COPY8:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
390    ; GFX78: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY8]], [[C]]
391    ; GFX78: [[COPY9:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
392    ; GFX78: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY9]], [[C]]
393    ; GFX78: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
394    ; GFX78: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32)
395    ; GFX78: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]]
396    ; GFX78: [[BITCAST:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR]](s32)
397    ; GFX78: [[COPY10:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
398    ; GFX78: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY10]], [[C]]
399    ; GFX78: [[COPY11:%[0-9]+]]:_(s32) = COPY [[COPY3]](s32)
400    ; GFX78: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY11]], [[C]]
401    ; GFX78: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C1]](s32)
402    ; GFX78: [[OR1:%[0-9]+]]:_(s32) = G_OR [[AND2]], [[SHL1]]
403    ; GFX78: [[BITCAST1:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR1]](s32)
404    ; GFX78: [[COPY12:%[0-9]+]]:_(s32) = COPY [[COPY4]](s32)
405    ; GFX78: [[AND4:%[0-9]+]]:_(s32) = G_AND [[COPY12]], [[C]]
406    ; GFX78: [[COPY13:%[0-9]+]]:_(s32) = COPY [[COPY5]](s32)
407    ; GFX78: [[AND5:%[0-9]+]]:_(s32) = G_AND [[COPY13]], [[C]]
408    ; GFX78: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[AND5]], [[C1]](s32)
409    ; GFX78: [[OR2:%[0-9]+]]:_(s32) = G_OR [[AND4]], [[SHL2]]
410    ; GFX78: [[BITCAST2:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR2]](s32)
411    ; GFX78: [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY6]](s32)
412    ; GFX78: [[AND6:%[0-9]+]]:_(s32) = G_AND [[COPY14]], [[C]]
413    ; GFX78: [[COPY15:%[0-9]+]]:_(s32) = COPY [[COPY7]](s32)
414    ; GFX78: [[AND7:%[0-9]+]]:_(s32) = G_AND [[COPY15]], [[C]]
415    ; GFX78: [[SHL3:%[0-9]+]]:_(s32) = G_SHL [[AND7]], [[C1]](s32)
416    ; GFX78: [[OR3:%[0-9]+]]:_(s32) = G_OR [[AND6]], [[SHL3]]
417    ; GFX78: [[BITCAST3:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR3]](s32)
418    ; GFX78: [[CONCAT_VECTORS:%[0-9]+]]:_(<8 x s16>) = G_CONCAT_VECTORS [[BITCAST]](<2 x s16>), [[BITCAST1]](<2 x s16>), [[BITCAST2]](<2 x s16>), [[BITCAST3]](<2 x s16>)
419    ; GFX78: S_NOP 0, implicit [[CONCAT_VECTORS]](<8 x s16>)
420    ; GFX9-LABEL: name: build_vector_v8s16
421    ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
422    ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
423    ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
424    ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY $vgpr3
425    ; GFX9: [[COPY4:%[0-9]+]]:_(s32) = COPY $vgpr4
426    ; GFX9: [[COPY5:%[0-9]+]]:_(s32) = COPY $vgpr5
427    ; GFX9: [[COPY6:%[0-9]+]]:_(s32) = COPY $vgpr6
428    ; GFX9: [[COPY7:%[0-9]+]]:_(s32) = COPY $vgpr7
429    ; GFX9: [[COPY8:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
430    ; GFX9: [[COPY9:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
431    ; GFX9: [[BUILD_VECTOR_TRUNC:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY8]](s32), [[COPY9]](s32)
432    ; GFX9: [[COPY10:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
433    ; GFX9: [[COPY11:%[0-9]+]]:_(s32) = COPY [[COPY3]](s32)
434    ; GFX9: [[BUILD_VECTOR_TRUNC1:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY10]](s32), [[COPY11]](s32)
435    ; GFX9: [[COPY12:%[0-9]+]]:_(s32) = COPY [[COPY4]](s32)
436    ; GFX9: [[COPY13:%[0-9]+]]:_(s32) = COPY [[COPY5]](s32)
437    ; GFX9: [[BUILD_VECTOR_TRUNC2:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY12]](s32), [[COPY13]](s32)
438    ; GFX9: [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY6]](s32)
439    ; GFX9: [[COPY15:%[0-9]+]]:_(s32) = COPY [[COPY7]](s32)
440    ; GFX9: [[BUILD_VECTOR_TRUNC3:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY14]](s32), [[COPY15]](s32)
441    ; GFX9: [[CONCAT_VECTORS:%[0-9]+]]:_(<8 x s16>) = G_CONCAT_VECTORS [[BUILD_VECTOR_TRUNC]](<2 x s16>), [[BUILD_VECTOR_TRUNC1]](<2 x s16>), [[BUILD_VECTOR_TRUNC2]](<2 x s16>), [[BUILD_VECTOR_TRUNC3]](<2 x s16>)
442    ; GFX9: S_NOP 0, implicit [[CONCAT_VECTORS]](<8 x s16>)
443    %0:_(s32) = COPY $vgpr0
444    %1:_(s32) = COPY $vgpr1
445    %2:_(s32) = COPY $vgpr2
446    %3:_(s32) = COPY $vgpr3
447    %4:_(s32) = COPY $vgpr4
448    %5:_(s32) = COPY $vgpr5
449    %6:_(s32) = COPY $vgpr6
450    %7:_(s32) = COPY $vgpr7
451    %8:_(s16) = G_TRUNC %0
452    %9:_(s16) = G_TRUNC %1
453    %10:_(s16) = G_TRUNC %2
454    %11:_(s16) = G_TRUNC %3
455    %12:_(s16) = G_TRUNC %4
456    %13:_(s16) = G_TRUNC %5
457    %14:_(s16) = G_TRUNC %6
458    %15:_(s16) = G_TRUNC %7
459    %16:_(<8 x s16>) = G_BUILD_VECTOR %8, %9, %10, %11, %12, %13, %14, %15
460    S_NOP 0, implicit %16
461...
462
463---
464name: build_vector_v16s16
465body: |
466  bb.0:
467    liveins: $vgpr0, $vgpr1, $vgpr2, $vgpr3, $vgpr4, $vgpr5, $vgpr6, $vgpr7, $vgpr8, $vgpr9, $vgpr10, $vgpr11, $vgpr12, $vgpr13, $vgpr14, $vgpr15
468
469    ; GFX78-LABEL: name: build_vector_v16s16
470    ; GFX78: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
471    ; GFX78: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
472    ; GFX78: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
473    ; GFX78: [[COPY3:%[0-9]+]]:_(s32) = COPY $vgpr3
474    ; GFX78: [[COPY4:%[0-9]+]]:_(s32) = COPY $vgpr4
475    ; GFX78: [[COPY5:%[0-9]+]]:_(s32) = COPY $vgpr5
476    ; GFX78: [[COPY6:%[0-9]+]]:_(s32) = COPY $vgpr6
477    ; GFX78: [[COPY7:%[0-9]+]]:_(s32) = COPY $vgpr7
478    ; GFX78: [[COPY8:%[0-9]+]]:_(s32) = COPY $vgpr8
479    ; GFX78: [[COPY9:%[0-9]+]]:_(s32) = COPY $vgpr9
480    ; GFX78: [[COPY10:%[0-9]+]]:_(s32) = COPY $vgpr10
481    ; GFX78: [[COPY11:%[0-9]+]]:_(s32) = COPY $vgpr11
482    ; GFX78: [[COPY12:%[0-9]+]]:_(s32) = COPY $vgpr12
483    ; GFX78: [[COPY13:%[0-9]+]]:_(s32) = COPY $vgpr13
484    ; GFX78: [[COPY14:%[0-9]+]]:_(s32) = COPY $vgpr14
485    ; GFX78: [[COPY15:%[0-9]+]]:_(s32) = COPY $vgpr15
486    ; GFX78: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
487    ; GFX78: [[COPY16:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
488    ; GFX78: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY16]], [[C]]
489    ; GFX78: [[COPY17:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
490    ; GFX78: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY17]], [[C]]
491    ; GFX78: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
492    ; GFX78: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32)
493    ; GFX78: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]]
494    ; GFX78: [[BITCAST:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR]](s32)
495    ; GFX78: [[COPY18:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
496    ; GFX78: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY18]], [[C]]
497    ; GFX78: [[COPY19:%[0-9]+]]:_(s32) = COPY [[COPY3]](s32)
498    ; GFX78: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY19]], [[C]]
499    ; GFX78: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C1]](s32)
500    ; GFX78: [[OR1:%[0-9]+]]:_(s32) = G_OR [[AND2]], [[SHL1]]
501    ; GFX78: [[BITCAST1:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR1]](s32)
502    ; GFX78: [[COPY20:%[0-9]+]]:_(s32) = COPY [[COPY4]](s32)
503    ; GFX78: [[AND4:%[0-9]+]]:_(s32) = G_AND [[COPY20]], [[C]]
504    ; GFX78: [[COPY21:%[0-9]+]]:_(s32) = COPY [[COPY5]](s32)
505    ; GFX78: [[AND5:%[0-9]+]]:_(s32) = G_AND [[COPY21]], [[C]]
506    ; GFX78: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[AND5]], [[C1]](s32)
507    ; GFX78: [[OR2:%[0-9]+]]:_(s32) = G_OR [[AND4]], [[SHL2]]
508    ; GFX78: [[BITCAST2:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR2]](s32)
509    ; GFX78: [[COPY22:%[0-9]+]]:_(s32) = COPY [[COPY6]](s32)
510    ; GFX78: [[AND6:%[0-9]+]]:_(s32) = G_AND [[COPY22]], [[C]]
511    ; GFX78: [[COPY23:%[0-9]+]]:_(s32) = COPY [[COPY7]](s32)
512    ; GFX78: [[AND7:%[0-9]+]]:_(s32) = G_AND [[COPY23]], [[C]]
513    ; GFX78: [[SHL3:%[0-9]+]]:_(s32) = G_SHL [[AND7]], [[C1]](s32)
514    ; GFX78: [[OR3:%[0-9]+]]:_(s32) = G_OR [[AND6]], [[SHL3]]
515    ; GFX78: [[BITCAST3:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR3]](s32)
516    ; GFX78: [[COPY24:%[0-9]+]]:_(s32) = COPY [[COPY8]](s32)
517    ; GFX78: [[AND8:%[0-9]+]]:_(s32) = G_AND [[COPY24]], [[C]]
518    ; GFX78: [[COPY25:%[0-9]+]]:_(s32) = COPY [[COPY9]](s32)
519    ; GFX78: [[AND9:%[0-9]+]]:_(s32) = G_AND [[COPY25]], [[C]]
520    ; GFX78: [[SHL4:%[0-9]+]]:_(s32) = G_SHL [[AND9]], [[C1]](s32)
521    ; GFX78: [[OR4:%[0-9]+]]:_(s32) = G_OR [[AND8]], [[SHL4]]
522    ; GFX78: [[BITCAST4:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR4]](s32)
523    ; GFX78: [[COPY26:%[0-9]+]]:_(s32) = COPY [[COPY10]](s32)
524    ; GFX78: [[AND10:%[0-9]+]]:_(s32) = G_AND [[COPY26]], [[C]]
525    ; GFX78: [[COPY27:%[0-9]+]]:_(s32) = COPY [[COPY11]](s32)
526    ; GFX78: [[AND11:%[0-9]+]]:_(s32) = G_AND [[COPY27]], [[C]]
527    ; GFX78: [[SHL5:%[0-9]+]]:_(s32) = G_SHL [[AND11]], [[C1]](s32)
528    ; GFX78: [[OR5:%[0-9]+]]:_(s32) = G_OR [[AND10]], [[SHL5]]
529    ; GFX78: [[BITCAST5:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR5]](s32)
530    ; GFX78: [[COPY28:%[0-9]+]]:_(s32) = COPY [[COPY12]](s32)
531    ; GFX78: [[AND12:%[0-9]+]]:_(s32) = G_AND [[COPY28]], [[C]]
532    ; GFX78: [[COPY29:%[0-9]+]]:_(s32) = COPY [[COPY13]](s32)
533    ; GFX78: [[AND13:%[0-9]+]]:_(s32) = G_AND [[COPY29]], [[C]]
534    ; GFX78: [[SHL6:%[0-9]+]]:_(s32) = G_SHL [[AND13]], [[C1]](s32)
535    ; GFX78: [[OR6:%[0-9]+]]:_(s32) = G_OR [[AND12]], [[SHL6]]
536    ; GFX78: [[BITCAST6:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR6]](s32)
537    ; GFX78: [[COPY30:%[0-9]+]]:_(s32) = COPY [[COPY14]](s32)
538    ; GFX78: [[AND14:%[0-9]+]]:_(s32) = G_AND [[COPY30]], [[C]]
539    ; GFX78: [[COPY31:%[0-9]+]]:_(s32) = COPY [[COPY15]](s32)
540    ; GFX78: [[AND15:%[0-9]+]]:_(s32) = G_AND [[COPY31]], [[C]]
541    ; GFX78: [[SHL7:%[0-9]+]]:_(s32) = G_SHL [[AND15]], [[C1]](s32)
542    ; GFX78: [[OR7:%[0-9]+]]:_(s32) = G_OR [[AND14]], [[SHL7]]
543    ; GFX78: [[BITCAST7:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR7]](s32)
544    ; GFX78: [[CONCAT_VECTORS:%[0-9]+]]:_(<16 x s16>) = G_CONCAT_VECTORS [[BITCAST]](<2 x s16>), [[BITCAST1]](<2 x s16>), [[BITCAST2]](<2 x s16>), [[BITCAST3]](<2 x s16>), [[BITCAST4]](<2 x s16>), [[BITCAST5]](<2 x s16>), [[BITCAST6]](<2 x s16>), [[BITCAST7]](<2 x s16>)
545    ; GFX78: S_NOP 0, implicit [[CONCAT_VECTORS]](<16 x s16>)
546    ; GFX9-LABEL: name: build_vector_v16s16
547    ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
548    ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
549    ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
550    ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY $vgpr3
551    ; GFX9: [[COPY4:%[0-9]+]]:_(s32) = COPY $vgpr4
552    ; GFX9: [[COPY5:%[0-9]+]]:_(s32) = COPY $vgpr5
553    ; GFX9: [[COPY6:%[0-9]+]]:_(s32) = COPY $vgpr6
554    ; GFX9: [[COPY7:%[0-9]+]]:_(s32) = COPY $vgpr7
555    ; GFX9: [[COPY8:%[0-9]+]]:_(s32) = COPY $vgpr8
556    ; GFX9: [[COPY9:%[0-9]+]]:_(s32) = COPY $vgpr9
557    ; GFX9: [[COPY10:%[0-9]+]]:_(s32) = COPY $vgpr10
558    ; GFX9: [[COPY11:%[0-9]+]]:_(s32) = COPY $vgpr11
559    ; GFX9: [[COPY12:%[0-9]+]]:_(s32) = COPY $vgpr12
560    ; GFX9: [[COPY13:%[0-9]+]]:_(s32) = COPY $vgpr13
561    ; GFX9: [[COPY14:%[0-9]+]]:_(s32) = COPY $vgpr14
562    ; GFX9: [[COPY15:%[0-9]+]]:_(s32) = COPY $vgpr15
563    ; GFX9: [[COPY16:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
564    ; GFX9: [[COPY17:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
565    ; GFX9: [[BUILD_VECTOR_TRUNC:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY16]](s32), [[COPY17]](s32)
566    ; GFX9: [[COPY18:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
567    ; GFX9: [[COPY19:%[0-9]+]]:_(s32) = COPY [[COPY3]](s32)
568    ; GFX9: [[BUILD_VECTOR_TRUNC1:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY18]](s32), [[COPY19]](s32)
569    ; GFX9: [[COPY20:%[0-9]+]]:_(s32) = COPY [[COPY4]](s32)
570    ; GFX9: [[COPY21:%[0-9]+]]:_(s32) = COPY [[COPY5]](s32)
571    ; GFX9: [[BUILD_VECTOR_TRUNC2:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY20]](s32), [[COPY21]](s32)
572    ; GFX9: [[COPY22:%[0-9]+]]:_(s32) = COPY [[COPY6]](s32)
573    ; GFX9: [[COPY23:%[0-9]+]]:_(s32) = COPY [[COPY7]](s32)
574    ; GFX9: [[BUILD_VECTOR_TRUNC3:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY22]](s32), [[COPY23]](s32)
575    ; GFX9: [[COPY24:%[0-9]+]]:_(s32) = COPY [[COPY8]](s32)
576    ; GFX9: [[COPY25:%[0-9]+]]:_(s32) = COPY [[COPY9]](s32)
577    ; GFX9: [[BUILD_VECTOR_TRUNC4:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY24]](s32), [[COPY25]](s32)
578    ; GFX9: [[COPY26:%[0-9]+]]:_(s32) = COPY [[COPY10]](s32)
579    ; GFX9: [[COPY27:%[0-9]+]]:_(s32) = COPY [[COPY11]](s32)
580    ; GFX9: [[BUILD_VECTOR_TRUNC5:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY26]](s32), [[COPY27]](s32)
581    ; GFX9: [[COPY28:%[0-9]+]]:_(s32) = COPY [[COPY12]](s32)
582    ; GFX9: [[COPY29:%[0-9]+]]:_(s32) = COPY [[COPY13]](s32)
583    ; GFX9: [[BUILD_VECTOR_TRUNC6:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY28]](s32), [[COPY29]](s32)
584    ; GFX9: [[COPY30:%[0-9]+]]:_(s32) = COPY [[COPY14]](s32)
585    ; GFX9: [[COPY31:%[0-9]+]]:_(s32) = COPY [[COPY15]](s32)
586    ; GFX9: [[BUILD_VECTOR_TRUNC7:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY30]](s32), [[COPY31]](s32)
587    ; GFX9: [[CONCAT_VECTORS:%[0-9]+]]:_(<16 x s16>) = G_CONCAT_VECTORS [[BUILD_VECTOR_TRUNC]](<2 x s16>), [[BUILD_VECTOR_TRUNC1]](<2 x s16>), [[BUILD_VECTOR_TRUNC2]](<2 x s16>), [[BUILD_VECTOR_TRUNC3]](<2 x s16>), [[BUILD_VECTOR_TRUNC4]](<2 x s16>), [[BUILD_VECTOR_TRUNC5]](<2 x s16>), [[BUILD_VECTOR_TRUNC6]](<2 x s16>), [[BUILD_VECTOR_TRUNC7]](<2 x s16>)
588    ; GFX9: S_NOP 0, implicit [[CONCAT_VECTORS]](<16 x s16>)
589    %0:_(s32) = COPY $vgpr0
590    %1:_(s32) = COPY $vgpr1
591    %2:_(s32) = COPY $vgpr2
592    %3:_(s32) = COPY $vgpr3
593    %4:_(s32) = COPY $vgpr4
594    %5:_(s32) = COPY $vgpr5
595    %6:_(s32) = COPY $vgpr6
596    %7:_(s32) = COPY $vgpr7
597    %8:_(s32) = COPY $vgpr8
598    %9:_(s32) = COPY $vgpr9
599    %10:_(s32) = COPY $vgpr10
600    %11:_(s32) = COPY $vgpr11
601    %12:_(s32) = COPY $vgpr12
602    %13:_(s32) = COPY $vgpr13
603    %14:_(s32) = COPY $vgpr14
604    %15:_(s32) = COPY $vgpr15
605    %16:_(s16) = G_TRUNC %0
606    %17:_(s16) = G_TRUNC %1
607    %18:_(s16) = G_TRUNC %2
608    %19:_(s16) = G_TRUNC %3
609    %20:_(s16) = G_TRUNC %4
610    %21:_(s16) = G_TRUNC %5
611    %22:_(s16) = G_TRUNC %6
612    %23:_(s16) = G_TRUNC %7
613    %24:_(s16) = G_TRUNC %8
614    %25:_(s16) = G_TRUNC %9
615    %26:_(s16) = G_TRUNC %10
616    %27:_(s16) = G_TRUNC %11
617    %28:_(s16) = G_TRUNC %12
618    %29:_(s16) = G_TRUNC %13
619    %30:_(s16) = G_TRUNC %14
620    %31:_(s16) = G_TRUNC %15
621    %32:_(<16 x s16>) = G_BUILD_VECTOR  %16, %17, %18, %19, %20, %21, %22, %23, %24, %25, %26, %27, %28, %29, %30, %31
622    S_NOP 0, implicit %32
623...
624