1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=amdgcn-mesa-mesa3d -mcpu=tahiti -run-pass=legalizer -global-isel-abort=0 -o - %s | FileCheck %s
5 name: test_unmerge_values_s1_trunc_v2s1_of_build_vector_v2s32
8 ; CHECK-LABEL: name: test_unmerge_values_s1_trunc_v2s1_of_build_vector_v2s32
9 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
10 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
11 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
12 ; CHECK: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>)
13 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](s32), [[UV2]]
14 ; CHECK: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](s32), [[UV3]]
15 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP]](s1)
16 ; CHECK: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP1]](s1)
17 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ANYEXT]](s32)
18 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
19 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY2]], [[C]](s32)
20 ; CHECK: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
21 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[ANYEXT1]](s32)
22 ; CHECK: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY3]], [[C]](s32)
23 ; CHECK: [[ASHR1:%[0-9]+]]:_(s32) = G_ASHR [[SHL1]], [[C]](s32)
24 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[ASHR]](s32), [[ASHR1]](s32)
25 ; CHECK: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
26 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
27 %1:_(<2 x s32>) = COPY $vgpr0_vgpr1
28 %2:_(s32), %3:_(s32) = G_UNMERGE_VALUES %0(<2 x s32>)
29 %4:_(s32), %5:_(s32) = G_UNMERGE_VALUES %1(<2 x s32>)
30 %6:_(s1) = G_ICMP intpred(ne), %2(s32), %4
31 %7:_(s1) = G_ICMP intpred(ne), %3(s32), %5
32 %8:_(s32) = G_ANYEXT %6(s1)
33 %9:_(s32) = G_ANYEXT %7(s1)
34 %10:_(<2 x s32>) = G_BUILD_VECTOR %8, %9
35 %11:_(<2 x s1>) = G_TRUNC %10(<2 x s32>)
36 %12:_(s1), %13:_(s1) = G_UNMERGE_VALUES %11
37 %14:_(s32) = G_SEXT %12
38 %15:_(s32) = G_SEXT %13
39 %16:_(<2 x s32>) = G_BUILD_VECTOR %14, %15
40 $vgpr0_vgpr1 = COPY %16
44 # Requires looking thorugh extra copies between the build_vector,
47 name: test_unmerge_values_s1_trunc_v2s1_of_build_vector_v2s32_extra_copies
50 ; CHECK-LABEL: name: test_unmerge_values_s1_trunc_v2s1_of_build_vector_v2s32_extra_copies
51 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
52 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
53 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
54 ; CHECK: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>)
55 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](s32), [[UV2]]
56 ; CHECK: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](s32), [[UV3]]
57 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP]](s1)
58 ; CHECK: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP1]](s1)
59 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ANYEXT]](s32)
60 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
61 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY2]], [[C]](s32)
62 ; CHECK: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
63 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[ANYEXT1]](s32)
64 ; CHECK: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY3]], [[C]](s32)
65 ; CHECK: [[ASHR1:%[0-9]+]]:_(s32) = G_ASHR [[SHL1]], [[C]](s32)
66 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[ASHR]](s32), [[ASHR1]](s32)
67 ; CHECK: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
68 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
69 %1:_(<2 x s32>) = COPY $vgpr0_vgpr1
70 %2:_(s32), %3:_(s32) = G_UNMERGE_VALUES %0(<2 x s32>)
71 %4:_(s32), %5:_(s32) = G_UNMERGE_VALUES %1(<2 x s32>)
72 %6:_(s1) = G_ICMP intpred(ne), %2(s32), %4
73 %7:_(s1) = G_ICMP intpred(ne), %3(s32), %5
74 %8:_(s32) = G_ANYEXT %6(s1)
75 %9:_(s32) = G_ANYEXT %7(s1)
76 %10:_(<2 x s32>) = G_BUILD_VECTOR %8, %9
77 %11:_(<2 x s32>) = COPY %10
78 %12:_(<2 x s1>) = G_TRUNC %11(<2 x s32>)
79 %13:_(<2 x s1>) = COPY %12
80 %14:_(s1), %15:_(s1) = G_UNMERGE_VALUES %13
81 %16:_(s32) = G_SEXT %14
82 %17:_(s32) = G_SEXT %15
83 %18:_(<2 x s32>) = G_BUILD_VECTOR %16, %17
84 $vgpr0_vgpr1 = COPY %18
89 name: test_unmerge_values_s32_sext_v2s32_of_build_vector_v2s16
92 ; CHECK-LABEL: name: test_unmerge_values_s32_sext_v2s32_of_build_vector_v2s16
93 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
94 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
95 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
96 ; CHECK: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>)
97 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](s32), [[UV2]]
98 ; CHECK: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](s32), [[UV3]]
99 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s16) = G_ANYEXT [[ICMP]](s1)
100 ; CHECK: [[ANYEXT1:%[0-9]+]]:_(s16) = G_ANYEXT [[ICMP1]](s1)
101 ; CHECK: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[ANYEXT]](s16)
102 ; CHECK: [[SEXT1:%[0-9]+]]:_(s32) = G_SEXT [[ANYEXT1]](s16)
103 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[SEXT]](s32), [[SEXT1]](s32)
104 ; CHECK: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
105 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
106 %1:_(<2 x s32>) = COPY $vgpr0_vgpr1
107 %2:_(s32), %3:_(s32) = G_UNMERGE_VALUES %0(<2 x s32>)
108 %4:_(s32), %5:_(s32) = G_UNMERGE_VALUES %1(<2 x s32>)
109 %6:_(s1) = G_ICMP intpred(ne), %2(s32), %4
110 %7:_(s1) = G_ICMP intpred(ne), %3(s32), %5
111 %8:_(s16) = G_ANYEXT %6
112 %9:_(s16) = G_ANYEXT %7
113 %10:_(<2 x s16>) = G_BUILD_VECTOR %8, %9
114 %11:_(<2 x s32>) = G_SEXT %10
115 %12:_(s32), %13:_(s32) = G_UNMERGE_VALUES %11
116 %14:_(<2 x s32>) = G_BUILD_VECTOR %12, %13
117 $vgpr0_vgpr1 = COPY %14
122 name: test_unmerge_values_s32_zext_v2s32_of_build_vector_v2s16
125 ; CHECK-LABEL: name: test_unmerge_values_s32_zext_v2s32_of_build_vector_v2s16
126 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
127 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
128 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
129 ; CHECK: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>)
130 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](s32), [[UV2]]
131 ; CHECK: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](s32), [[UV3]]
132 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s16) = G_ANYEXT [[ICMP]](s1)
133 ; CHECK: [[ANYEXT1:%[0-9]+]]:_(s16) = G_ANYEXT [[ICMP1]](s1)
134 ; CHECK: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[ANYEXT]](s16)
135 ; CHECK: [[ZEXT1:%[0-9]+]]:_(s32) = G_ZEXT [[ANYEXT1]](s16)
136 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[ZEXT]](s32), [[ZEXT1]](s32)
137 ; CHECK: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
138 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
139 %1:_(<2 x s32>) = COPY $vgpr0_vgpr1
140 %2:_(s32), %3:_(s32) = G_UNMERGE_VALUES %0(<2 x s32>)
141 %4:_(s32), %5:_(s32) = G_UNMERGE_VALUES %1(<2 x s32>)
142 %6:_(s1) = G_ICMP intpred(ne), %2(s32), %4
143 %7:_(s1) = G_ICMP intpred(ne), %3(s32), %5
144 %8:_(s16) = G_ANYEXT %6(s1)
145 %9:_(s16) = G_ANYEXT %7(s1)
146 %10:_(<2 x s16>) = G_BUILD_VECTOR %8, %9
147 %11:_(<2 x s32>) = G_ZEXT %10
148 %12:_(s32), %13:_(s32) = G_UNMERGE_VALUES %11
149 %14:_(<2 x s32>) = G_BUILD_VECTOR %12(s32), %13(s32)
150 $vgpr0_vgpr1 = COPY %14(<2 x s32>)
155 name: test_unmerge_values_s32_anyext_v2s32_of_build_vector_v2s16
158 ; CHECK-LABEL: name: test_unmerge_values_s32_anyext_v2s32_of_build_vector_v2s16
159 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
160 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
161 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
162 ; CHECK: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>)
163 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](s32), [[UV2]]
164 ; CHECK: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](s32), [[UV3]]
165 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP]](s1)
166 ; CHECK: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP1]](s1)
167 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[ANYEXT]](s32), [[ANYEXT1]](s32)
168 ; CHECK: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
169 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
170 %1:_(<2 x s32>) = COPY $vgpr0_vgpr1
171 %2:_(s32), %3:_(s32) = G_UNMERGE_VALUES %0(<2 x s32>)
172 %4:_(s32), %5:_(s32) = G_UNMERGE_VALUES %1(<2 x s32>)
173 %6:_(s1) = G_ICMP intpred(ne), %2(s32), %4
174 %7:_(s1) = G_ICMP intpred(ne), %3(s32), %5
175 %8:_(s16) = G_ANYEXT %6(s1)
176 %9:_(s16) = G_ANYEXT %7(s1)
177 %10:_(<2 x s16>) = G_BUILD_VECTOR %8, %9
178 %11:_(<2 x s32>) = G_ANYEXT %10
179 %12:_(s32), %13:_(s32) = G_UNMERGE_VALUES %11
180 %14:_(<2 x s32>) = G_BUILD_VECTOR %12, %13
181 $vgpr0_vgpr1 = COPY %14
186 name: test_unmerge_values_v2s16_zext_v4s32_of_build_vector_v4s16
190 ; CHECK-LABEL: name: test_unmerge_values_v2s16_zext_v4s32_of_build_vector_v4s16
191 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
192 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
193 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
194 ; CHECK: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>)
195 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](s32), [[UV2]]
196 ; CHECK: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](s32), [[UV3]]
197 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s16) = G_ANYEXT [[ICMP]](s1)
198 ; CHECK: [[ANYEXT1:%[0-9]+]]:_(s16) = G_ANYEXT [[ICMP1]](s1)
199 ; CHECK: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[ANYEXT]](s16)
200 ; CHECK: [[ZEXT1:%[0-9]+]]:_(s32) = G_ZEXT [[ANYEXT1]](s16)
201 ; CHECK: [[ZEXT2:%[0-9]+]]:_(s32) = G_ZEXT [[ANYEXT]](s16)
202 ; CHECK: [[ZEXT3:%[0-9]+]]:_(s32) = G_ZEXT [[ANYEXT1]](s16)
203 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[ZEXT]](s32), [[ZEXT1]](s32), [[ZEXT2]](s32), [[ZEXT3]](s32)
204 ; CHECK: [[UV4:%[0-9]+]]:_(<2 x s16>), [[UV5:%[0-9]+]]:_(<2 x s16>), [[UV6:%[0-9]+]]:_(<2 x s16>), [[UV7:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[BUILD_VECTOR]](<4 x s32>)
205 ; CHECK: S_ENDPGM 0, implicit [[UV4]](<2 x s16>), implicit [[UV5]](<2 x s16>), implicit [[UV6]](<2 x s16>), implicit [[UV7]](<2 x s16>)
206 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
207 %1:_(<2 x s32>) = COPY $vgpr0_vgpr1
208 %2:_(s32), %3:_(s32) = G_UNMERGE_VALUES %0(<2 x s32>)
209 %4:_(s32), %5:_(s32) = G_UNMERGE_VALUES %1(<2 x s32>)
210 %6:_(s1) = G_ICMP intpred(ne), %2(s32), %4
211 %7:_(s1) = G_ICMP intpred(ne), %3(s32), %5
212 %8:_(s16) = G_ANYEXT %6
213 %9:_(s16) = G_ANYEXT %7
214 %10:_(<4 x s16>) = G_BUILD_VECTOR %8, %9, %8, %9
215 %11:_(<4 x s32>) = G_ZEXT %10
216 %12:_(<2 x s16>), %13:_(<2 x s16>), %14:_(<2 x s16>), %15:_(<2 x s16>) = G_UNMERGE_VALUES %11
217 S_ENDPGM 0, implicit %12, implicit %13, implicit %14, implicit %15
222 name: test_unmerge_values_s1_trunc_v4s1_of_concat_vectors_v4s32_v2s32
225 ; CHECK-LABEL: name: test_unmerge_values_s1_trunc_v4s1_of_concat_vectors_v4s32_v2s32
226 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
227 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
228 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
229 ; CHECK: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>)
230 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[UV]](s32)
231 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
232 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY2]], [[C]](s32)
233 ; CHECK: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
234 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
235 ; CHECK: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY3]], [[C]](s32)
236 ; CHECK: [[ASHR1:%[0-9]+]]:_(s32) = G_ASHR [[SHL1]], [[C]](s32)
237 ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[UV2]](s32)
238 ; CHECK: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[COPY4]], [[C]](s32)
239 ; CHECK: [[ASHR2:%[0-9]+]]:_(s32) = G_ASHR [[SHL2]], [[C]](s32)
240 ; CHECK: [[COPY5:%[0-9]+]]:_(s32) = COPY [[UV3]](s32)
241 ; CHECK: [[SHL3:%[0-9]+]]:_(s32) = G_SHL [[COPY5]], [[C]](s32)
242 ; CHECK: [[ASHR3:%[0-9]+]]:_(s32) = G_ASHR [[SHL3]], [[C]](s32)
243 ; CHECK: $vgpr0 = COPY [[ASHR]](s32)
244 ; CHECK: $vgpr1 = COPY [[ASHR1]](s32)
245 ; CHECK: $vgpr2 = COPY [[ASHR2]](s32)
246 ; CHECK: $vgpr3 = COPY [[ASHR3]](s32)
247 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
248 %1:_(<2 x s32>) = COPY $vgpr2_vgpr3
249 %2:_(<4 x s32>) = G_CONCAT_VECTORS %0, %1
250 %3:_(<4 x s1>) = G_TRUNC %2
251 %4:_(s1), %5:_(s1), %6:_(s1), %7:_(s1) = G_UNMERGE_VALUES %3
252 %8:_(s32) = G_SEXT %4
253 %9:_(s32) = G_SEXT %5
254 %10:_(s32) = G_SEXT %6
255 %11:_(s32) = G_SEXT %7
263 name: test_unmerge_values_s16_of_concat_vectors_v2s16_v2s16
266 ; CHECK-LABEL: name: test_unmerge_values_s16_of_concat_vectors_v2s16_v2s16
267 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
268 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr1
269 ; CHECK: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>)
270 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[BITCAST]](s32)
271 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
272 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
273 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32)
274 ; CHECK: [[BITCAST1:%[0-9]+]]:_(s32) = G_BITCAST [[COPY1]](<2 x s16>)
275 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[BITCAST1]](s32)
276 ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST1]], [[C]](s32)
277 ; CHECK: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR1]](s32)
278 ; CHECK: S_ENDPGM 0, implicit [[TRUNC]](s16), implicit [[TRUNC1]](s16), implicit [[TRUNC2]](s16), implicit [[TRUNC3]](s16)
279 %0:_(<2 x s16>) = COPY $vgpr0
280 %1:_(<2 x s16>) = COPY $vgpr1
281 %2:_(<4 x s16>) = G_CONCAT_VECTORS %0, %1
282 %3:_(s16), %4:_(s16), %5:_(s16), %6:_(s16) = G_UNMERGE_VALUES %2
283 S_ENDPGM 0, implicit %3, implicit %4, implicit %5, implicit %6
287 name: test_unmerge_values_s32_of_concat_vectors_v2s32_v2s32
290 ; CHECK-LABEL: name: test_unmerge_values_s32_of_concat_vectors_v2s32_v2s32
291 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
292 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr1_vgpr2
293 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
294 ; CHECK: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>)
295 ; CHECK: S_ENDPGM 0, implicit [[UV]](s32), implicit [[UV1]](s32), implicit [[UV2]](s32), implicit [[UV3]](s32)
296 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
297 %1:_(<2 x s32>) = COPY $vgpr1_vgpr2
298 %2:_(<4 x s32>) = G_CONCAT_VECTORS %0, %1
299 %3:_(s32), %4:_(s32), %5:_(s32), %6:_(s32) = G_UNMERGE_VALUES %2
300 S_ENDPGM 0, implicit %3, implicit %4, implicit %5, implicit %6
304 name: test_unmerge_values_s32_of_concat_vectors_v2s64_v2s64
307 ; CHECK-LABEL: name: test_unmerge_values_s32_of_concat_vectors_v2s64_v2s64
308 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
309 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7
310 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s64>)
311 ; CHECK: [[UV4:%[0-9]+]]:_(s32), [[UV5:%[0-9]+]]:_(s32), [[UV6:%[0-9]+]]:_(s32), [[UV7:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s64>)
312 ; CHECK: S_ENDPGM 0, implicit [[UV]](s32), implicit [[UV1]](s32), implicit [[UV2]](s32), implicit [[UV3]](s32), implicit [[UV4]](s32), implicit [[UV5]](s32), implicit [[UV6]](s32), implicit [[UV7]](s32)
313 %0:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
314 %1:_(<2 x s64>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7
315 %2:_(<4 x s64>) = G_CONCAT_VECTORS %0, %1
316 %3:_(s32), %4:_(s32), %5:_(s32), %6:_(s32), %7:_(s32), %8:_(s32), %9:_(s32), %10:_(s32) = G_UNMERGE_VALUES %2
317 S_ENDPGM 0, implicit %3, implicit %4, implicit %5, implicit %6, implicit %7, implicit %8, implicit %9, implicit %10
321 name: test_unmerge_values_s32_of_trunc_concat_vectors_v2s64_v2s64
324 ; CHECK-LABEL: name: test_unmerge_values_s32_of_trunc_concat_vectors_v2s64_v2s64
325 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
326 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7
327 ; CHECK: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](<2 x s64>)
328 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[UV]](s64)
329 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[UV1]](s64)
330 ; CHECK: [[UV2:%[0-9]+]]:_(s64), [[UV3:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY1]](<2 x s64>)
331 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s32) = G_TRUNC [[UV2]](s64)
332 ; CHECK: [[TRUNC3:%[0-9]+]]:_(s32) = G_TRUNC [[UV3]](s64)
333 ; CHECK: S_ENDPGM 0, implicit [[TRUNC]](s32), implicit [[TRUNC1]](s32), implicit [[TRUNC2]](s32), implicit [[TRUNC3]](s32)
334 %0:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
335 %1:_(<2 x s64>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7
336 %2:_(<4 x s64>) = G_CONCAT_VECTORS %0, %1
337 %3:_(<4 x s32>) = G_TRUNC %2
338 %4:_(s32), %5:_(s32), %6:_(s32), %7:_(s32) = G_UNMERGE_VALUES %3
339 S_ENDPGM 0, implicit %4, implicit %5, implicit %6, implicit %7
343 name: test_unmerge_values_s64_of_sext_concat_vectors_v2s32_v2s32
346 ; CHECK-LABEL: name: test_unmerge_values_s64_of_sext_concat_vectors_v2s32_v2s32
347 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
348 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
349 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
350 ; CHECK: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[UV]](s32)
351 ; CHECK: [[SEXT1:%[0-9]+]]:_(s64) = G_SEXT [[UV1]](s32)
352 ; CHECK: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>)
353 ; CHECK: [[SEXT2:%[0-9]+]]:_(s64) = G_SEXT [[UV2]](s32)
354 ; CHECK: [[SEXT3:%[0-9]+]]:_(s64) = G_SEXT [[UV3]](s32)
355 ; CHECK: S_ENDPGM 0, implicit [[SEXT]](s64), implicit [[SEXT1]](s64), implicit [[SEXT2]](s64), implicit [[SEXT3]](s64)
356 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
357 %1:_(<2 x s32>) = COPY $vgpr2_vgpr3
358 %2:_(<4 x s32>) = G_CONCAT_VECTORS %0, %1
359 %3:_(<4 x s64>) = G_SEXT %2
360 %4:_(s64), %5:_(s64), %6:_(s64), %7:_(s64) = G_UNMERGE_VALUES %3
361 S_ENDPGM 0, implicit %4, implicit %5, implicit %6, implicit %7
365 name: test_unmerge_values_s64_of_zext_concat_vectors_v2s32_v2s32
368 ; CHECK-LABEL: name: test_unmerge_values_s64_of_zext_concat_vectors_v2s32_v2s32
369 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
370 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
371 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
372 ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[UV]](s32)
373 ; CHECK: [[ZEXT1:%[0-9]+]]:_(s64) = G_ZEXT [[UV1]](s32)
374 ; CHECK: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>)
375 ; CHECK: [[ZEXT2:%[0-9]+]]:_(s64) = G_ZEXT [[UV2]](s32)
376 ; CHECK: [[ZEXT3:%[0-9]+]]:_(s64) = G_ZEXT [[UV3]](s32)
377 ; CHECK: S_ENDPGM 0, implicit [[ZEXT]](s64), implicit [[ZEXT1]](s64), implicit [[ZEXT2]](s64), implicit [[ZEXT3]](s64)
378 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
379 %1:_(<2 x s32>) = COPY $vgpr2_vgpr3
380 %2:_(<4 x s32>) = G_CONCAT_VECTORS %0, %1
381 %3:_(<4 x s64>) = G_ZEXT %2
382 %4:_(s64), %5:_(s64), %6:_(s64), %7:_(s64) = G_UNMERGE_VALUES %3
383 S_ENDPGM 0, implicit %4, implicit %5, implicit %6, implicit %7
387 name: test_unmerge_values_s64_of_anyext_concat_vectors_v2s32_v2s32
390 ; CHECK-LABEL: name: test_unmerge_values_s64_of_anyext_concat_vectors_v2s32_v2s32
391 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
392 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
393 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
394 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[UV]](s32)
395 ; CHECK: [[ANYEXT1:%[0-9]+]]:_(s64) = G_ANYEXT [[UV1]](s32)
396 ; CHECK: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>)
397 ; CHECK: [[ANYEXT2:%[0-9]+]]:_(s64) = G_ANYEXT [[UV2]](s32)
398 ; CHECK: [[ANYEXT3:%[0-9]+]]:_(s64) = G_ANYEXT [[UV3]](s32)
399 ; CHECK: S_ENDPGM 0, implicit [[ANYEXT]](s64), implicit [[ANYEXT1]](s64), implicit [[ANYEXT2]](s64), implicit [[ANYEXT3]](s64)
400 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
401 %1:_(<2 x s32>) = COPY $vgpr2_vgpr3
402 %2:_(<4 x s32>) = G_CONCAT_VECTORS %0, %1
403 %3:_(<4 x s64>) = G_ANYEXT %2
404 %4:_(s64), %5:_(s64), %6:_(s64), %7:_(s64) = G_UNMERGE_VALUES %3
405 S_ENDPGM 0, implicit %4, implicit %5, implicit %6, implicit %7
409 name: test_unmerge_values_s8_of_trunc_v4s16_concat_vectors_v2s32_v2s32
412 ; CHECK-LABEL: name: test_unmerge_values_s8_of_trunc_v4s16_concat_vectors_v2s32_v2s32
413 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
414 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
415 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
416 ; CHECK: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[UV]](s32)
417 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[UV1]](s32)
418 ; CHECK: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>)
419 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s8) = G_TRUNC [[UV2]](s32)
420 ; CHECK: [[TRUNC3:%[0-9]+]]:_(s8) = G_TRUNC [[UV3]](s32)
421 ; CHECK: S_ENDPGM 0, implicit [[TRUNC]](s8), implicit [[TRUNC1]](s8), implicit %6:_(s8), implicit %7:_(s8), implicit [[TRUNC2]](s8), implicit [[TRUNC3]](s8), implicit %10:_(s8), implicit %11:_(s8)
422 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
423 %1:_(<2 x s32>) = COPY $vgpr2_vgpr3
424 %2:_(<4 x s32>) = G_CONCAT_VECTORS %0, %1
425 %3:_(<4 x s16>) = G_TRUNC %2
426 %4:_(s8), %5:_(s8), %6:_(s8), %7:_(s8), %8:_(s8), %9:_(s8), %10:_(s8), %11:_(s8) = G_UNMERGE_VALUES %3
427 S_ENDPGM 0, implicit %4, implicit %5, implicit %6, implicit %7, implicit %8, implicit %9, implicit %10, implicit %11
431 name: test_unmerge_values_s16_of_anyext_v4s64_concat_vectors_v2s32_v2s32
434 ; CHECK-LABEL: name: test_unmerge_values_s16_of_anyext_v4s64_concat_vectors_v2s32_v2s32
435 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
436 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
437 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
438 ; CHECK: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>)
439 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[UV]](s32)
440 ; CHECK: [[ANYEXT1:%[0-9]+]]:_(s64) = G_ANYEXT [[UV1]](s32)
441 ; CHECK: [[ANYEXT2:%[0-9]+]]:_(s64) = G_ANYEXT [[UV2]](s32)
442 ; CHECK: [[ANYEXT3:%[0-9]+]]:_(s64) = G_ANYEXT [[UV3]](s32)
443 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s64>) = G_BUILD_VECTOR [[ANYEXT]](s64), [[ANYEXT1]](s64), [[ANYEXT2]](s64), [[ANYEXT3]](s64)
444 ; CHECK: [[UV4:%[0-9]+]]:_(s16), [[UV5:%[0-9]+]]:_(s16), [[UV6:%[0-9]+]]:_(s16), [[UV7:%[0-9]+]]:_(s16), [[UV8:%[0-9]+]]:_(s16), [[UV9:%[0-9]+]]:_(s16), [[UV10:%[0-9]+]]:_(s16), [[UV11:%[0-9]+]]:_(s16), [[UV12:%[0-9]+]]:_(s16), [[UV13:%[0-9]+]]:_(s16), [[UV14:%[0-9]+]]:_(s16), [[UV15:%[0-9]+]]:_(s16), [[UV16:%[0-9]+]]:_(s16), [[UV17:%[0-9]+]]:_(s16), [[UV18:%[0-9]+]]:_(s16), [[UV19:%[0-9]+]]:_(s16) = G_UNMERGE_VALUES [[BUILD_VECTOR]](<4 x s64>)
445 ; CHECK: S_ENDPGM 0, implicit [[UV4]](s16), implicit [[UV5]](s16), implicit [[UV6]](s16), implicit [[UV7]](s16)
446 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
447 %1:_(<2 x s32>) = COPY $vgpr2_vgpr3
448 %2:_(<4 x s32>) = G_CONCAT_VECTORS %0, %1
449 %3:_(<4 x s64>) = G_ANYEXT %2
450 %4:_(s16), %5:_(s16), %6:_(s16), %7:_(s16), %8:_(s16), %9:_(s16), %10:_(s16), %11:_(s16), %12:_(s16), %13:_(s16), %14:_(s16), %15:_(s16), %16:_(s16), %17:_(s16), %18:_(s16), %19:_(s16) = G_UNMERGE_VALUES %3
451 S_ENDPGM 0, implicit %4, implicit %5, implicit %6, implicit %7
456 name: test_unmerge_values_s32_of_concat_vectors_v4s32_v4s32
459 ; CHECK-LABEL: name: test_unmerge_values_s32_of_concat_vectors_v4s32_v4s32
460 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
461 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
462 ; CHECK: [[COPY2:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr4_vgpr5
463 ; CHECK: [[COPY3:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr6_vgpr7
464 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<8 x s32>) = G_CONCAT_VECTORS [[COPY]](<2 x s32>), [[COPY1]](<2 x s32>), [[COPY2]](<2 x s32>), [[COPY3]](<2 x s32>)
465 ; CHECK: [[TRUNC:%[0-9]+]]:_(<8 x s16>) = G_TRUNC [[CONCAT_VECTORS]](<8 x s32>)
466 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[TRUNC]](<8 x s16>)
467 ; CHECK: S_ENDPGM 0, implicit [[UV]](s32), implicit [[UV1]](s32), implicit [[UV2]](s32), implicit [[UV3]](s32)
468 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
469 %1:_(<2 x s32>) = COPY $vgpr2_vgpr3
470 %2:_(<2 x s32>) = COPY $vgpr4_vgpr5
471 %3:_(<2 x s32>) = COPY $vgpr6_vgpr7
472 %4:_(<8 x s32>) = G_CONCAT_VECTORS %0, %1, %2, %3
473 %5:_(<8 x s16>) = G_TRUNC %4
474 %6:_(s32), %7:_(s32), %8:_(s32), %9:_(s32) = G_UNMERGE_VALUES %5
475 S_ENDPGM 0, implicit %6, implicit %7, implicit %8, implicit %9
479 name: test_unmerge_values_s64_of_build_vector_v4s32
482 ; CHECK-LABEL: name: test_unmerge_values_s64_of_build_vector_v4s32
483 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
484 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
485 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
486 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY $vgpr3
487 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[COPY]](s32), [[COPY1]](s32), [[COPY2]](s32), [[COPY3]](s32)
488 ; CHECK: [[TRUNC:%[0-9]+]]:_(<4 x s16>) = G_TRUNC [[BUILD_VECTOR]](<4 x s32>)
489 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[TRUNC]](<4 x s16>)
490 ; CHECK: S_ENDPGM 0, implicit [[UV]](s32), implicit [[UV1]](s32)
491 %0:_(s32) = COPY $vgpr0
492 %1:_(s32) = COPY $vgpr1
493 %2:_(s32) = COPY $vgpr2
494 %3:_(s32) = COPY $vgpr3
495 %4:_(<4 x s32>) = G_BUILD_VECTOR %0, %1, %2, %3
496 %5:_(<4 x s16>) = G_TRUNC %4
497 %6:_(s32), %7:_(s32) = G_UNMERGE_VALUES %5
498 S_ENDPGM 0, implicit %6, implicit %7