1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -O0 -run-pass=legalizer -global-isel-abort=0 %s -o - | FileCheck %s
8 liveins: $vgpr0, $vgpr1
10 ; CHECK-LABEL: name: test_or_s32
11 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
12 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
13 ; CHECK: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY]], [[COPY1]]
14 ; CHECK: $vgpr0 = COPY [[OR]](s32)
15 %0:_(s32) = COPY $vgpr0
16 %1:_(s32) = COPY $vgpr1
17 %2:_(s32) = G_OR %0, %1
25 liveins: $vgpr0, $vgpr1
27 ; CHECK-LABEL: name: test_or_s1
28 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
29 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
30 ; CHECK: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY]], [[COPY1]]
31 ; CHECK: S_NOP 0, implicit [[OR]](s32)
32 %0:_(s32) = COPY $vgpr0
33 %1:_(s32) = COPY $vgpr1
34 %2:_(s32) = G_CONSTANT i32 0
35 %3:_(s1) = G_ICMP intpred(ne), %0, %2
36 %4:_(s1) = G_ICMP intpred(ne), %1, %2
37 %5:_(s32) = G_OR %0, %1
45 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
47 ; CHECK-LABEL: name: test_or_s64
48 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
49 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
50 ; CHECK: [[OR:%[0-9]+]]:_(s64) = G_OR [[COPY]], [[COPY1]]
51 ; CHECK: $vgpr0_vgpr1 = COPY [[OR]](s64)
52 %0:_(s64) = COPY $vgpr0_vgpr1
53 %1:_(s64) = COPY $vgpr2_vgpr3
54 %2:_(s64) = G_OR %0, %1
55 $vgpr0_vgpr1 = COPY %2
62 liveins: $vgpr0_vgpr1_vgpr2, $vgpr3_vgpr4_vgpr5
64 ; CHECK-LABEL: name: test_or_s96
65 ; CHECK: [[COPY:%[0-9]+]]:_(s96) = COPY $vgpr0_vgpr1_vgpr2
66 ; CHECK: [[COPY1:%[0-9]+]]:_(s96) = COPY $vgpr3_vgpr4_vgpr5
67 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s64) = G_EXTRACT [[COPY]](s96), 0
68 ; CHECK: [[EXTRACT1:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s96), 64
69 ; CHECK: [[EXTRACT2:%[0-9]+]]:_(s64) = G_EXTRACT [[COPY1]](s96), 0
70 ; CHECK: [[EXTRACT3:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY1]](s96), 64
71 ; CHECK: [[OR:%[0-9]+]]:_(s64) = G_OR [[EXTRACT]], [[EXTRACT2]]
72 ; CHECK: [[OR1:%[0-9]+]]:_(s32) = G_OR [[EXTRACT1]], [[EXTRACT3]]
73 ; CHECK: [[DEF:%[0-9]+]]:_(s96) = G_IMPLICIT_DEF
74 ; CHECK: [[INSERT:%[0-9]+]]:_(s96) = G_INSERT [[DEF]], [[OR]](s64), 0
75 ; CHECK: [[INSERT1:%[0-9]+]]:_(s96) = G_INSERT [[INSERT]], [[OR1]](s32), 64
76 ; CHECK: $vgpr0_vgpr1_vgpr2 = COPY [[INSERT1]](s96)
77 %0:_(s96) = COPY $vgpr0_vgpr1_vgpr2
78 %1:_(s96) = COPY $vgpr3_vgpr4_vgpr5
79 %2:_(s96) = G_OR %0, %1
80 $vgpr0_vgpr1_vgpr2 = COPY %2
87 liveins: $vgpr0_vgpr1_vgpr2_vgpr3, $vgpr4_vgpr5_vgpr6_vgpr7
89 ; CHECK-LABEL: name: test_or_128
90 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
91 ; CHECK: [[COPY1:%[0-9]+]]:_(s128) = COPY $vgpr4_vgpr5_vgpr6_vgpr7
92 ; CHECK: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](s128)
93 ; CHECK: [[UV2:%[0-9]+]]:_(s64), [[UV3:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY1]](s128)
94 ; CHECK: [[OR:%[0-9]+]]:_(s64) = G_OR [[UV]], [[UV2]]
95 ; CHECK: [[OR1:%[0-9]+]]:_(s64) = G_OR [[UV1]], [[UV3]]
96 ; CHECK: [[MV:%[0-9]+]]:_(s128) = G_MERGE_VALUES [[OR]](s64), [[OR1]](s64)
97 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[MV]](s128)
98 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
99 %1:_(s128) = COPY $vgpr4_vgpr5_vgpr6_vgpr7
100 %2:_(s128) = G_OR %0, %1
101 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %2
108 liveins: $vgpr0, $vgpr1
110 ; CHECK-LABEL: name: test_or_s7
111 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
112 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
113 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
114 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
115 ; CHECK: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY2]], [[COPY3]]
116 ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[OR]](s32)
117 ; CHECK: $vgpr0 = COPY [[COPY4]](s32)
118 %0:_(s32) = COPY $vgpr0
119 %1:_(s32) = COPY $vgpr1
120 %2:_(s7) = G_TRUNC %0
121 %3:_(s7) = G_TRUNC %1
122 %4:_(s7) = G_OR %2, %3
123 %5:_(s32) = G_ANYEXT %4
131 liveins: $vgpr0, $vgpr1
133 ; CHECK-LABEL: name: test_or_s8
134 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
135 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
136 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
137 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
138 ; CHECK: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY2]], [[COPY3]]
139 ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[OR]](s32)
140 ; CHECK: $vgpr0 = COPY [[COPY4]](s32)
141 %0:_(s32) = COPY $vgpr0
142 %1:_(s32) = COPY $vgpr1
143 %2:_(s8) = G_TRUNC %0
144 %3:_(s8) = G_TRUNC %1
145 %4:_(s8) = G_OR %2, %3
146 %5:_(s32) = G_ANYEXT %4
154 liveins: $vgpr0, $vgpr1
156 ; CHECK-LABEL: name: test_or_s16
157 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
158 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
159 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
160 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
161 ; CHECK: [[OR:%[0-9]+]]:_(s16) = G_OR [[TRUNC]], [[TRUNC1]]
162 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
163 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32)
164 %0:_(s32) = COPY $vgpr0
165 %1:_(s32) = COPY $vgpr1
166 %2:_(s16) = G_TRUNC %0
167 %3:_(s16) = G_TRUNC %1
168 %4:_(s16) = G_OR %2, %3
169 %5:_(s32) = G_ANYEXT %4
177 liveins: $vgpr0, $vgpr1
179 ; CHECK-LABEL: name: test_or_s24
180 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
181 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
182 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
183 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
184 ; CHECK: [[OR:%[0-9]+]]:_(s16) = G_OR [[TRUNC]], [[TRUNC1]]
185 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
186 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32)
187 %0:_(s32) = COPY $vgpr0
188 %1:_(s32) = COPY $vgpr1
189 %2:_(s16) = G_TRUNC %0
190 %3:_(s16) = G_TRUNC %1
191 %4:_(s16) = G_OR %2, %3
192 %5:_(s32) = G_ANYEXT %4
200 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
202 ; CHECK-LABEL: name: test_or_s48
203 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
204 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
205 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY [[COPY]](s64)
206 ; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY [[COPY1]](s64)
207 ; CHECK: [[OR:%[0-9]+]]:_(s64) = G_OR [[COPY2]], [[COPY3]]
208 ; CHECK: [[COPY4:%[0-9]+]]:_(s64) = COPY [[OR]](s64)
209 ; CHECK: $vgpr0_vgpr1 = COPY [[COPY4]](s64)
210 %0:_(s64) = COPY $vgpr0_vgpr1
211 %1:_(s64) = COPY $vgpr2_vgpr3
212 %2:_(s48) = G_TRUNC %0
213 %3:_(s48) = G_TRUNC %1
214 %4:_(s48) = G_OR %2, %3
215 %5:_(s64) = G_ANYEXT %4
216 $vgpr0_vgpr1 = COPY %5
223 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
225 ; CHECK-LABEL: name: test_or_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: [[OR:%[0-9]+]]:_(<2 x s32>) = G_OR [[COPY]], [[COPY1]]
229 ; CHECK: $vgpr0_vgpr1 = COPY [[OR]](<2 x s32>)
230 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
231 %1:_(<2 x s32>) = COPY $vgpr2_vgpr3
232 %2:_(<2 x s32>) = G_OR %0, %1
233 $vgpr0_vgpr1 = COPY %2
240 liveins: $vgpr0_vgpr1_vgpr2, $vgpr3_vgpr4_vgpr5
242 ; CHECK-LABEL: name: test_or_v3s32
243 ; CHECK: [[COPY:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
244 ; CHECK: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr3_vgpr4_vgpr5
245 ; CHECK: [[DEF:%[0-9]+]]:_(<3 x s32>) = G_IMPLICIT_DEF
246 ; CHECK: [[EXTRACT:%[0-9]+]]:_(<2 x s32>) = G_EXTRACT [[COPY]](<3 x s32>), 0
247 ; CHECK: [[EXTRACT1:%[0-9]+]]:_(<2 x s32>) = G_EXTRACT [[COPY1]](<3 x s32>), 0
248 ; CHECK: [[OR:%[0-9]+]]:_(<2 x s32>) = G_OR [[EXTRACT]], [[EXTRACT1]]
249 ; CHECK: [[INSERT:%[0-9]+]]:_(<3 x s32>) = G_INSERT [[DEF]], [[OR]](<2 x s32>), 0
250 ; CHECK: [[EXTRACT2:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](<3 x s32>), 64
251 ; CHECK: [[EXTRACT3:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY1]](<3 x s32>), 64
252 ; CHECK: [[OR1:%[0-9]+]]:_(s32) = G_OR [[EXTRACT2]], [[EXTRACT3]]
253 ; CHECK: [[INSERT1:%[0-9]+]]:_(<3 x s32>) = G_INSERT [[INSERT]], [[OR1]](s32), 64
254 ; CHECK: $vgpr0_vgpr1_vgpr2 = COPY [[INSERT1]](<3 x s32>)
255 %0:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
256 %1:_(<3 x s32>) = COPY $vgpr3_vgpr4_vgpr5
257 %2:_(<3 x s32>) = G_OR %0, %1
258 $vgpr0_vgpr1_vgpr2 = COPY %2
265 liveins: $vgpr0_vgpr1_vgpr2_vgpr3, $vgpr4_vgpr5_vgpr6_vgpr7
267 ; CHECK-LABEL: name: test_or_v4s32
268 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
269 ; CHECK: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7
270 ; CHECK: [[UV:%[0-9]+]]:_(<2 x s32>), [[UV1:%[0-9]+]]:_(<2 x s32>) = G_UNMERGE_VALUES [[COPY]](<4 x s32>)
271 ; CHECK: [[UV2:%[0-9]+]]:_(<2 x s32>), [[UV3:%[0-9]+]]:_(<2 x s32>) = G_UNMERGE_VALUES [[COPY1]](<4 x s32>)
272 ; CHECK: [[OR:%[0-9]+]]:_(<2 x s32>) = G_OR [[UV]], [[UV2]]
273 ; CHECK: [[OR1:%[0-9]+]]:_(<2 x s32>) = G_OR [[UV1]], [[UV3]]
274 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s32>) = G_CONCAT_VECTORS [[OR]](<2 x s32>), [[OR1]](<2 x s32>)
275 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[CONCAT_VECTORS]](<4 x s32>)
276 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
277 %1:_(<4 x s32>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7
278 %2:_(<4 x s32>) = G_OR %0, %1
279 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %2
287 ; CHECK-LABEL: name: test_or_v5s32
288 ; CHECK: [[DEF:%[0-9]+]]:_(<5 x s32>) = G_IMPLICIT_DEF
289 ; CHECK: [[DEF1:%[0-9]+]]:_(<5 x s32>) = G_IMPLICIT_DEF
290 ; CHECK: [[DEF2:%[0-9]+]]:_(<5 x s32>) = G_IMPLICIT_DEF
291 ; CHECK: [[EXTRACT:%[0-9]+]]:_(<2 x s32>) = G_EXTRACT [[DEF]](<5 x s32>), 0
292 ; CHECK: [[EXTRACT1:%[0-9]+]]:_(<2 x s32>) = G_EXTRACT [[DEF1]](<5 x s32>), 0
293 ; CHECK: [[OR:%[0-9]+]]:_(<2 x s32>) = G_OR [[EXTRACT]], [[EXTRACT1]]
294 ; CHECK: [[INSERT:%[0-9]+]]:_(<5 x s32>) = G_INSERT [[DEF2]], [[OR]](<2 x s32>), 0
295 ; CHECK: [[EXTRACT2:%[0-9]+]]:_(<2 x s32>) = G_EXTRACT [[DEF]](<5 x s32>), 64
296 ; CHECK: [[EXTRACT3:%[0-9]+]]:_(<2 x s32>) = G_EXTRACT [[DEF1]](<5 x s32>), 64
297 ; CHECK: [[OR1:%[0-9]+]]:_(<2 x s32>) = G_OR [[EXTRACT2]], [[EXTRACT3]]
298 ; CHECK: [[INSERT1:%[0-9]+]]:_(<5 x s32>) = G_INSERT [[INSERT]], [[OR1]](<2 x s32>), 64
299 ; CHECK: [[EXTRACT4:%[0-9]+]]:_(s32) = G_EXTRACT [[DEF]](<5 x s32>), 128
300 ; CHECK: [[EXTRACT5:%[0-9]+]]:_(s32) = G_EXTRACT [[DEF1]](<5 x s32>), 128
301 ; CHECK: [[OR2:%[0-9]+]]:_(s32) = G_OR [[EXTRACT4]], [[EXTRACT5]]
302 ; CHECK: [[INSERT2:%[0-9]+]]:_(<5 x s32>) = G_INSERT [[INSERT1]], [[OR2]](s32), 128
303 ; CHECK: [[DEF3:%[0-9]+]]:_(<8 x s32>) = G_IMPLICIT_DEF
304 ; CHECK: [[INSERT3:%[0-9]+]]:_(<8 x s32>) = G_INSERT [[DEF3]], [[INSERT2]](<5 x s32>), 0
305 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY [[INSERT3]](<8 x s32>)
306 %0:_(<5 x s32>) = G_IMPLICIT_DEF
307 %1:_(<5 x s32>) = G_IMPLICIT_DEF
308 %2:_(<5 x s32>) = G_OR %0, %1
309 %3:_(<8 x s32>) = G_IMPLICIT_DEF
310 %4:_(<8 x s32>) = G_INSERT %3, %2, 0
311 $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY %4
318 liveins: $vgpr0_vgpr1_vgpr2_vgpr3, $vgpr4_vgpr5_vgpr6_vgpr7
320 ; CHECK-LABEL: name: test_or_v2s64
321 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
322 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7
323 ; CHECK: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](<2 x s64>)
324 ; CHECK: [[UV2:%[0-9]+]]:_(s64), [[UV3:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY1]](<2 x s64>)
325 ; CHECK: [[OR:%[0-9]+]]:_(s64) = G_OR [[UV]], [[UV2]]
326 ; CHECK: [[OR1:%[0-9]+]]:_(s64) = G_OR [[UV1]], [[UV3]]
327 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[OR]](s64), [[OR1]](s64)
328 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x s64>)
329 %0:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
330 %1:_(<2 x s64>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7
331 %2:_(<2 x s64>) = G_OR %0, %1
332 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %2
339 liveins: $vgpr0, $vgpr1
341 ; CHECK-LABEL: name: test_or_v2s16
342 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
343 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr1
344 ; CHECK: [[OR:%[0-9]+]]:_(<2 x s16>) = G_OR [[COPY]], [[COPY1]]
345 ; CHECK: $vgpr0 = COPY [[OR]](<2 x s16>)
346 %0:_(<2 x s16>) = COPY $vgpr0
347 %1:_(<2 x s16>) = COPY $vgpr1
348 %2:_(<2 x s16>) = G_OR %0, %1
357 ; CHECK-LABEL: name: test_or_v3s16
358 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
359 ; CHECK: [[EXTRACT:%[0-9]+]]:_(<3 x s16>) = G_EXTRACT [[DEF]](<4 x s16>), 0
360 ; CHECK: [[DEF1:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
361 ; CHECK: [[EXTRACT1:%[0-9]+]]:_(<3 x s16>) = G_EXTRACT [[DEF1]](<4 x s16>), 0
362 ; CHECK: [[DEF2:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
363 ; CHECK: [[INSERT:%[0-9]+]]:_(<4 x s16>) = G_INSERT [[DEF2]], [[EXTRACT]](<3 x s16>), 0
364 ; CHECK: [[DEF3:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
365 ; CHECK: [[INSERT1:%[0-9]+]]:_(<4 x s16>) = G_INSERT [[DEF3]], [[EXTRACT1]](<3 x s16>), 0
366 ; CHECK: [[OR:%[0-9]+]]:_(<4 x s16>) = G_OR [[INSERT]], [[INSERT1]]
367 ; CHECK: [[EXTRACT2:%[0-9]+]]:_(<3 x s16>) = G_EXTRACT [[OR]](<4 x s16>), 0
368 ; CHECK: [[DEF4:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
369 ; CHECK: [[INSERT2:%[0-9]+]]:_(<4 x s16>) = G_INSERT [[DEF4]], [[EXTRACT2]](<3 x s16>), 0
370 ; CHECK: $vgpr0_vgpr1 = COPY [[INSERT2]](<4 x s16>)
371 %0:_(<3 x s16>) = G_IMPLICIT_DEF
372 %1:_(<3 x s16>) = G_IMPLICIT_DEF
373 %2:_(<3 x s16>) = G_OR %0, %1
374 %4:_(<4 x s16>) = G_IMPLICIT_DEF
375 %5:_(<4 x s16>) = G_INSERT %4, %2, 0
376 $vgpr0_vgpr1 = COPY %5
383 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
385 ; CHECK-LABEL: name: test_or_v4s16
386 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $vgpr0_vgpr1
387 ; CHECK: [[COPY1:%[0-9]+]]:_(<4 x s16>) = COPY $vgpr2_vgpr3
388 ; CHECK: [[OR:%[0-9]+]]:_(<4 x s16>) = G_OR [[COPY]], [[COPY1]]
389 ; CHECK: $vgpr0_vgpr1 = COPY [[OR]](<4 x s16>)
390 %0:_(<4 x s16>) = COPY $vgpr0_vgpr1
391 %1:_(<4 x s16>) = COPY $vgpr2_vgpr3
392 %2:_(<4 x s16>) = G_OR %0, %1
393 $vgpr0_vgpr1 = COPY %2
401 ; CHECK-LABEL: name: test_or_v5s16
402 ; CHECK: [[DEF:%[0-9]+]]:_(<6 x s32>) = G_IMPLICIT_DEF
403 ; CHECK: [[TRUNC:%[0-9]+]]:_(<6 x s16>) = G_TRUNC [[DEF]](<6 x s32>)
404 ; CHECK: [[EXTRACT:%[0-9]+]]:_(<5 x s16>) = G_EXTRACT [[TRUNC]](<6 x s16>), 0
405 ; CHECK: [[DEF1:%[0-9]+]]:_(<6 x s32>) = G_IMPLICIT_DEF
406 ; CHECK: [[TRUNC1:%[0-9]+]]:_(<6 x s16>) = G_TRUNC [[DEF1]](<6 x s32>)
407 ; CHECK: [[EXTRACT1:%[0-9]+]]:_(<5 x s16>) = G_EXTRACT [[TRUNC1]](<6 x s16>), 0
408 ; CHECK: [[DEF2:%[0-9]+]]:_(<6 x s32>) = G_IMPLICIT_DEF
409 ; CHECK: [[TRUNC2:%[0-9]+]]:_(<6 x s16>) = G_TRUNC [[DEF2]](<6 x s32>)
410 ; CHECK: [[INSERT:%[0-9]+]]:_(<6 x s16>) = G_INSERT [[TRUNC2]], [[EXTRACT]](<5 x s16>), 0
411 ; CHECK: [[DEF3:%[0-9]+]]:_(<6 x s32>) = G_IMPLICIT_DEF
412 ; CHECK: [[TRUNC3:%[0-9]+]]:_(<6 x s16>) = G_TRUNC [[DEF3]](<6 x s32>)
413 ; CHECK: [[INSERT1:%[0-9]+]]:_(<6 x s16>) = G_INSERT [[TRUNC3]], [[EXTRACT1]](<5 x s16>), 0
414 ; CHECK: [[UV:%[0-9]+]]:_(<3 x s16>), [[UV1:%[0-9]+]]:_(<3 x s16>) = G_UNMERGE_VALUES [[INSERT]](<6 x s16>)
415 ; CHECK: [[UV2:%[0-9]+]]:_(<3 x s16>), [[UV3:%[0-9]+]]:_(<3 x s16>) = G_UNMERGE_VALUES [[INSERT1]](<6 x s16>)
416 ; CHECK: [[DEF4:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
417 ; CHECK: [[INSERT2:%[0-9]+]]:_(<4 x s16>) = G_INSERT [[DEF4]], [[UV]](<3 x s16>), 0
418 ; CHECK: [[DEF5:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
419 ; CHECK: [[INSERT3:%[0-9]+]]:_(<4 x s16>) = G_INSERT [[DEF5]], [[UV2]](<3 x s16>), 0
420 ; CHECK: [[OR:%[0-9]+]]:_(<4 x s16>) = G_OR [[INSERT2]], [[INSERT3]]
421 ; CHECK: [[EXTRACT2:%[0-9]+]]:_(<3 x s16>) = G_EXTRACT [[OR]](<4 x s16>), 0
422 ; CHECK: [[DEF6:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
423 ; CHECK: [[INSERT4:%[0-9]+]]:_(<4 x s16>) = G_INSERT [[DEF6]], [[UV1]](<3 x s16>), 0
424 ; CHECK: [[DEF7:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
425 ; CHECK: [[INSERT5:%[0-9]+]]:_(<4 x s16>) = G_INSERT [[DEF7]], [[UV3]](<3 x s16>), 0
426 ; CHECK: [[OR1:%[0-9]+]]:_(<4 x s16>) = G_OR [[INSERT4]], [[INSERT5]]
427 ; CHECK: [[EXTRACT3:%[0-9]+]]:_(<3 x s16>) = G_EXTRACT [[OR1]](<4 x s16>), 0
428 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<6 x s16>) = G_CONCAT_VECTORS [[EXTRACT2]](<3 x s16>), [[EXTRACT3]](<3 x s16>)
429 ; CHECK: [[EXTRACT4:%[0-9]+]]:_(<5 x s16>) = G_EXTRACT [[CONCAT_VECTORS]](<6 x s16>), 0
430 ; CHECK: [[DEF8:%[0-9]+]]:_(<8 x s32>) = G_IMPLICIT_DEF
431 ; CHECK: [[TRUNC4:%[0-9]+]]:_(<8 x s16>) = G_TRUNC [[DEF8]](<8 x s32>)
432 ; CHECK: [[INSERT6:%[0-9]+]]:_(<8 x s16>) = G_INSERT [[TRUNC4]], [[EXTRACT4]](<5 x s16>), 0
433 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[INSERT6]](<8 x s16>)
434 %0:_(<5 x s16>) = G_IMPLICIT_DEF
435 %1:_(<5 x s16>) = G_IMPLICIT_DEF
436 %2:_(<5 x s16>) = G_OR %0, %1
437 %3:_(<8 x s16>) = G_IMPLICIT_DEF
438 %4:_(<8 x s16>) = G_INSERT %3, %2, 0
439 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %4
447 ; CHECK-LABEL: name: test_or_v3s8
448 ; CHECK: [[DEF:%[0-9]+]]:_(<3 x s8>) = G_IMPLICIT_DEF
449 ; CHECK: [[DEF1:%[0-9]+]]:_(<3 x s8>) = G_IMPLICIT_DEF
450 ; CHECK: [[DEF2:%[0-9]+]]:_(<4 x s8>) = G_IMPLICIT_DEF
451 ; CHECK: [[INSERT:%[0-9]+]]:_(<4 x s8>) = G_INSERT [[DEF2]], [[DEF]](<3 x s8>), 0
452 ; CHECK: [[DEF3:%[0-9]+]]:_(<4 x s8>) = G_IMPLICIT_DEF
453 ; CHECK: [[ANYEXT:%[0-9]+]]:_(<4 x s16>) = G_ANYEXT [[DEF3]](<4 x s8>)
454 ; CHECK: [[INSERT1:%[0-9]+]]:_(<4 x s16>) = G_INSERT [[ANYEXT]], [[DEF1]](<3 x s8>), 0
455 ; CHECK: [[TRUNC:%[0-9]+]]:_(<4 x s8>) = G_TRUNC [[INSERT1]](<4 x s16>)
456 ; CHECK: [[UV:%[0-9]+]]:_(s8), [[UV1:%[0-9]+]]:_(s8), [[UV2:%[0-9]+]]:_(s8), [[UV3:%[0-9]+]]:_(s8) = G_UNMERGE_VALUES [[INSERT]](<4 x s8>)
457 ; CHECK: [[UV4:%[0-9]+]]:_(s8), [[UV5:%[0-9]+]]:_(s8), [[UV6:%[0-9]+]]:_(s8), [[UV7:%[0-9]+]]:_(s8) = G_UNMERGE_VALUES [[TRUNC]](<4 x s8>)
458 ; CHECK: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[UV]](s8)
459 ; CHECK: [[ANYEXT2:%[0-9]+]]:_(s32) = G_ANYEXT [[UV4]](s8)
460 ; CHECK: [[OR:%[0-9]+]]:_(s32) = G_OR [[ANYEXT1]], [[ANYEXT2]]
461 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[OR]](s32)
462 ; CHECK: [[ANYEXT3:%[0-9]+]]:_(s32) = G_ANYEXT [[UV1]](s8)
463 ; CHECK: [[ANYEXT4:%[0-9]+]]:_(s32) = G_ANYEXT [[UV5]](s8)
464 ; CHECK: [[OR1:%[0-9]+]]:_(s32) = G_OR [[ANYEXT3]], [[ANYEXT4]]
465 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s8) = G_TRUNC [[OR1]](s32)
466 ; CHECK: [[ANYEXT5:%[0-9]+]]:_(s32) = G_ANYEXT [[UV2]](s8)
467 ; CHECK: [[ANYEXT6:%[0-9]+]]:_(s32) = G_ANYEXT [[UV6]](s8)
468 ; CHECK: [[OR2:%[0-9]+]]:_(s32) = G_OR [[ANYEXT5]], [[ANYEXT6]]
469 ; CHECK: [[TRUNC3:%[0-9]+]]:_(s8) = G_TRUNC [[OR2]](s32)
470 ; CHECK: [[ANYEXT7:%[0-9]+]]:_(s32) = G_ANYEXT [[UV3]](s8)
471 ; CHECK: [[ANYEXT8:%[0-9]+]]:_(s32) = G_ANYEXT [[UV7]](s8)
472 ; CHECK: [[OR3:%[0-9]+]]:_(s32) = G_OR [[ANYEXT7]], [[ANYEXT8]]
473 ; CHECK: [[TRUNC4:%[0-9]+]]:_(s8) = G_TRUNC [[OR3]](s32)
474 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s8>) = G_BUILD_VECTOR [[TRUNC1]](s8), [[TRUNC2]](s8), [[TRUNC3]](s8), [[TRUNC4]](s8)
475 ; CHECK: [[EXTRACT:%[0-9]+]]:_(<3 x s8>) = G_EXTRACT [[BUILD_VECTOR]](<4 x s8>), 0
476 ; CHECK: [[ANYEXT9:%[0-9]+]]:_(<3 x s32>) = G_ANYEXT [[EXTRACT]](<3 x s8>)
477 ; CHECK: $vgpr0_vgpr1_vgpr2 = COPY [[ANYEXT9]](<3 x s32>)
478 %0:_(<3 x s8>) = G_IMPLICIT_DEF
479 %1:_(<3 x s8>) = G_IMPLICIT_DEF
480 %2:_(<3 x s8>) = G_OR %0, %1
481 %3:_(<3 x s32>) = G_ANYEXT %2
482 $vgpr0_vgpr1_vgpr2 = COPY %3
490 ; CHECK-LABEL: name: test_or_v4s8
491 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF
492 ; CHECK: [[TRUNC:%[0-9]+]]:_(<4 x s8>) = G_TRUNC [[DEF]](<4 x s32>)
493 ; CHECK: [[DEF1:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF
494 ; CHECK: [[TRUNC1:%[0-9]+]]:_(<4 x s8>) = G_TRUNC [[DEF1]](<4 x s32>)
495 ; CHECK: [[UV:%[0-9]+]]:_(s8), [[UV1:%[0-9]+]]:_(s8), [[UV2:%[0-9]+]]:_(s8), [[UV3:%[0-9]+]]:_(s8) = G_UNMERGE_VALUES [[TRUNC]](<4 x s8>)
496 ; CHECK: [[UV4:%[0-9]+]]:_(s8), [[UV5:%[0-9]+]]:_(s8), [[UV6:%[0-9]+]]:_(s8), [[UV7:%[0-9]+]]:_(s8) = G_UNMERGE_VALUES [[TRUNC1]](<4 x s8>)
497 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[UV]](s8)
498 ; CHECK: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[UV4]](s8)
499 ; CHECK: [[OR:%[0-9]+]]:_(s32) = G_OR [[ANYEXT]], [[ANYEXT1]]
500 ; CHECK: [[ANYEXT2:%[0-9]+]]:_(s32) = G_ANYEXT [[UV1]](s8)
501 ; CHECK: [[ANYEXT3:%[0-9]+]]:_(s32) = G_ANYEXT [[UV5]](s8)
502 ; CHECK: [[OR1:%[0-9]+]]:_(s32) = G_OR [[ANYEXT2]], [[ANYEXT3]]
503 ; CHECK: [[ANYEXT4:%[0-9]+]]:_(s32) = G_ANYEXT [[UV2]](s8)
504 ; CHECK: [[ANYEXT5:%[0-9]+]]:_(s32) = G_ANYEXT [[UV6]](s8)
505 ; CHECK: [[OR2:%[0-9]+]]:_(s32) = G_OR [[ANYEXT4]], [[ANYEXT5]]
506 ; CHECK: [[ANYEXT6:%[0-9]+]]:_(s32) = G_ANYEXT [[UV3]](s8)
507 ; CHECK: [[ANYEXT7:%[0-9]+]]:_(s32) = G_ANYEXT [[UV7]](s8)
508 ; CHECK: [[OR3:%[0-9]+]]:_(s32) = G_OR [[ANYEXT6]], [[ANYEXT7]]
509 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY [[OR]](s32)
510 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[OR1]](s32)
511 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[OR2]](s32)
512 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[OR3]](s32)
513 ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
514 ; CHECK: [[COPY5:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
515 ; CHECK: [[COPY6:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
516 ; CHECK: [[COPY7:%[0-9]+]]:_(s32) = COPY [[COPY3]](s32)
517 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[COPY4]](s32), [[COPY5]](s32), [[COPY6]](s32), [[COPY7]](s32)
518 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<4 x s32>)
519 %0:_(<4 x s8>) = G_IMPLICIT_DEF
520 %1:_(<4 x s8>) = G_IMPLICIT_DEF
521 %2:_(<4 x s8>) = G_OR %0, %1
522 %3:_(<4 x s32>) = G_ANYEXT %2
523 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %3