• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=tahiti -O0 -run-pass=legalizer -global-isel-abort=0 %s -o - | FileCheck -check-prefix=SI %s
3# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -O0 -run-pass=legalizer -global-isel-abort=0 %s -o - | FileCheck -check-prefix=VI %s
4---
5name: test_store_global_i32
6body: |
7  bb.0:
8    liveins: $vgpr0_vgpr1, $vgpr2
9
10    ; SI-LABEL: name: test_store_global_i32
11    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
12    ; SI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
13    ; SI: G_STORE [[COPY1]](s32), [[COPY]](p1) :: (store 4, addrspace 1)
14    ; VI-LABEL: name: test_store_global_i32
15    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
16    ; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
17    ; VI: G_STORE [[COPY1]](s32), [[COPY]](p1) :: (store 4, addrspace 1)
18    %0:_(p1) = COPY $vgpr0_vgpr1
19    %1:_(s32) = COPY $vgpr2
20    G_STORE %1, %0 :: (store 4, addrspace 1)
21...
22
23---
24name: test_store_global_i64
25body: |
26  bb.0:
27    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
28
29    ; SI-LABEL: name: test_store_global_i64
30    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
31    ; SI: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
32    ; SI: G_STORE [[COPY1]](s64), [[COPY]](p1) :: (store 8, addrspace 1)
33    ; VI-LABEL: name: test_store_global_i64
34    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
35    ; VI: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
36    ; VI: G_STORE [[COPY1]](s64), [[COPY]](p1) :: (store 8, addrspace 1)
37    %0:_(p1) = COPY $vgpr0_vgpr1
38    %1:_(s64) = COPY $vgpr2_vgpr3
39    G_STORE %1, %0 :: (store 8, addrspace 1)
40...
41
42---
43name: test_store_global_p1
44body: |
45  bb.0:
46    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
47
48    ; SI-LABEL: name: test_store_global_p1
49    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
50    ; SI: [[COPY1:%[0-9]+]]:_(p1) = COPY $vgpr2_vgpr3
51    ; SI: G_STORE [[COPY1]](p1), [[COPY]](p1) :: (store 8, addrspace 1)
52    ; VI-LABEL: name: test_store_global_p1
53    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
54    ; VI: [[COPY1:%[0-9]+]]:_(p1) = COPY $vgpr2_vgpr3
55    ; VI: G_STORE [[COPY1]](p1), [[COPY]](p1) :: (store 8, addrspace 1)
56    %0:_(p1) = COPY $vgpr0_vgpr1
57    %1:_(p1) = COPY $vgpr2_vgpr3
58    G_STORE %1, %0 :: (store 8, addrspace 1)
59...
60
61---
62name: test_store_global_p4
63body: |
64  bb.0:
65    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
66
67    ; SI-LABEL: name: test_store_global_p4
68    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
69    ; SI: [[COPY1:%[0-9]+]]:_(p4) = COPY $vgpr2_vgpr3
70    ; SI: G_STORE [[COPY1]](p4), [[COPY]](p1) :: (store 8, addrspace 1)
71    ; VI-LABEL: name: test_store_global_p4
72    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
73    ; VI: [[COPY1:%[0-9]+]]:_(p4) = COPY $vgpr2_vgpr3
74    ; VI: G_STORE [[COPY1]](p4), [[COPY]](p1) :: (store 8, addrspace 1)
75    %0:_(p1) = COPY $vgpr0_vgpr1
76    %1:_(p4) = COPY $vgpr2_vgpr3
77    G_STORE %1, %0 :: (store 8, addrspace 1)
78...
79
80---
81name: test_store_global_p3
82body: |
83  bb.0:
84    liveins: $vgpr0_vgpr1, $vgpr2
85
86    ; SI-LABEL: name: test_store_global_p3
87    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
88    ; SI: [[COPY1:%[0-9]+]]:_(p3) = COPY $vgpr2
89    ; SI: G_STORE [[COPY1]](p3), [[COPY]](p1) :: (store 4, addrspace 1)
90    ; VI-LABEL: name: test_store_global_p3
91    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
92    ; VI: [[COPY1:%[0-9]+]]:_(p3) = COPY $vgpr2
93    ; VI: G_STORE [[COPY1]](p3), [[COPY]](p1) :: (store 4, addrspace 1)
94    %0:_(p1) = COPY $vgpr0_vgpr1
95    %1:_(p3) = COPY $vgpr2
96    G_STORE %1, %0 :: (store 4, addrspace 1)
97...
98
99---
100name: test_store_global_v2s32
101body: |
102  bb.0:
103    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
104
105    ; SI-LABEL: name: test_store_global_v2s32
106    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
107    ; SI: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
108    ; SI: G_STORE [[COPY1]](<2 x s32>), [[COPY]](p1) :: (store 8, addrspace 1)
109    ; VI-LABEL: name: test_store_global_v2s32
110    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
111    ; VI: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
112    ; VI: G_STORE [[COPY1]](<2 x s32>), [[COPY]](p1) :: (store 8, addrspace 1)
113    %0:_(p1) = COPY $vgpr0_vgpr1
114    %1:_(<2 x s32>) = COPY $vgpr2_vgpr3
115    G_STORE %1, %0 :: (store 8, addrspace 1)
116...
117
118---
119name: test_store_global_v2s16
120body: |
121  bb.0:
122    liveins: $vgpr0_vgpr1, $vgpr2
123
124    ; SI-LABEL: name: test_store_global_v2s16
125    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
126    ; SI: [[COPY1:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr2
127    ; SI: G_STORE [[COPY1]](<2 x s16>), [[COPY]](p1) :: (store 4, addrspace 1)
128    ; VI-LABEL: name: test_store_global_v2s16
129    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
130    ; VI: [[COPY1:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr2
131    ; VI: G_STORE [[COPY1]](<2 x s16>), [[COPY]](p1) :: (store 4, addrspace 1)
132    %0:_(p1) = COPY $vgpr0_vgpr1
133    %1:_(<2 x s16>) = COPY $vgpr2
134    G_STORE %1, %0 :: (store 4, addrspace 1)
135...
136
137---
138name: test_store_global_v3s32
139body: |
140  bb.0:
141    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
142
143    ; SI-LABEL: name: test_store_global_v3s32
144    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
145    ; SI: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
146    ; SI: [[EXTRACT:%[0-9]+]]:_(<2 x s32>) = G_EXTRACT [[COPY1]](<3 x s32>), 0
147    ; SI: [[EXTRACT1:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY1]](<3 x s32>), 64
148    ; SI: G_STORE [[EXTRACT]](<2 x s32>), [[COPY]](p1) :: (store 8, align 4, addrspace 1)
149    ; SI: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
150    ; SI: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C]](s64)
151    ; SI: G_STORE [[EXTRACT1]](s32), [[PTR_ADD]](p1) :: (store 4 + 8, addrspace 1)
152    ; VI-LABEL: name: test_store_global_v3s32
153    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
154    ; VI: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
155    ; VI: G_STORE [[COPY1]](<3 x s32>), [[COPY]](p1) :: (store 12, align 4, addrspace 1)
156    %0:_(p1) = COPY $vgpr0_vgpr1
157    %1:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
158    G_STORE %1, %0 :: (store 12, align 4, addrspace 1)
159...
160
161---
162name: test_truncstore_global_s64_to_s8
163body: |
164  bb.0:
165    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
166
167    ; SI-LABEL: name: test_truncstore_global_s64_to_s8
168    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
169    ; SI: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
170    ; SI: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
171    ; SI: G_STORE [[TRUNC]](s32), [[COPY]](p1) :: (store 1, addrspace 1)
172    ; VI-LABEL: name: test_truncstore_global_s64_to_s8
173    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
174    ; VI: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
175    ; VI: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
176    ; VI: G_STORE [[TRUNC]](s32), [[COPY]](p1) :: (store 1, addrspace 1)
177    %0:_(p1) = COPY $vgpr0_vgpr1
178    %1:_(s64) = COPY $vgpr2_vgpr3
179    G_STORE %1, %0 :: (store 1, addrspace 1)
180...
181
182---
183name: test_truncstore_global_s64_to_s16
184body: |
185  bb.0:
186    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
187
188    ; SI-LABEL: name: test_truncstore_global_s64_to_s16
189    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
190    ; SI: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
191    ; SI: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
192    ; SI: G_STORE [[TRUNC]](s32), [[COPY]](p1) :: (store 1, addrspace 1)
193    ; VI-LABEL: name: test_truncstore_global_s64_to_s16
194    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
195    ; VI: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
196    ; VI: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
197    ; VI: G_STORE [[TRUNC]](s32), [[COPY]](p1) :: (store 1, addrspace 1)
198    %0:_(p1) = COPY $vgpr0_vgpr1
199    %1:_(s64) = COPY $vgpr2_vgpr3
200    G_STORE %1, %0 :: (store 1, addrspace 1)
201...
202
203---
204name: test_truncstore_global_s64_to_s32
205body: |
206  bb.0:
207    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
208
209    ; SI-LABEL: name: test_truncstore_global_s64_to_s32
210    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
211    ; SI: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
212    ; SI: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
213    ; SI: G_STORE [[TRUNC]](s32), [[COPY]](p1) :: (store 4, addrspace 1)
214    ; VI-LABEL: name: test_truncstore_global_s64_to_s32
215    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
216    ; VI: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
217    ; VI: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
218    ; VI: G_STORE [[TRUNC]](s32), [[COPY]](p1) :: (store 4, addrspace 1)
219    %0:_(p1) = COPY $vgpr0_vgpr1
220    %1:_(s64) = COPY $vgpr2_vgpr3
221    G_STORE %1, %0 :: (store 4, addrspace 1)
222...
223
224---
225name: test_truncstore_global_s128_to_s16
226body: |
227  bb.0:
228    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
229
230    ; SI-LABEL: name: test_truncstore_global_s128_to_s16
231    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
232    ; SI: [[COPY1:%[0-9]+]]:_(s128) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
233    ; SI: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s128)
234    ; SI: G_STORE [[TRUNC]](s32), [[COPY]](p1) :: (store 2, addrspace 1)
235    ; VI-LABEL: name: test_truncstore_global_s128_to_s16
236    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
237    ; VI: [[COPY1:%[0-9]+]]:_(s128) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
238    ; VI: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s128)
239    ; VI: G_STORE [[TRUNC]](s32), [[COPY]](p1) :: (store 2, addrspace 1)
240    %0:_(p1) = COPY $vgpr0_vgpr1
241    %1:_(s128) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
242    G_STORE %1, %0 :: (store 2, addrspace 1)
243...
244
245---
246name: test_truncstore_global_s128_to_s8
247body: |
248  bb.0:
249    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
250
251    ; SI-LABEL: name: test_truncstore_global_s128_to_s8
252    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
253    ; SI: [[COPY1:%[0-9]+]]:_(s128) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
254    ; SI: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s128)
255    ; SI: G_STORE [[TRUNC]](s32), [[COPY]](p1) :: (store 1, addrspace 1)
256    ; VI-LABEL: name: test_truncstore_global_s128_to_s8
257    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
258    ; VI: [[COPY1:%[0-9]+]]:_(s128) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
259    ; VI: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s128)
260    ; VI: G_STORE [[TRUNC]](s32), [[COPY]](p1) :: (store 1, addrspace 1)
261    %0:_(p1) = COPY $vgpr0_vgpr1
262    %1:_(s128) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
263    G_STORE %1, %0 :: (store 1, addrspace 1)
264...
265
266name: test_store_global_i1
267body: |
268  bb.0:
269    liveins: $vgpr0_vgpr1, $vgpr2
270
271    %0:_(p1) = COPY $vgpr0_vgpr1
272    %1:_(s32) = COPY $vgpr2
273    %2:_(s1) = G_TRUNC %1
274    G_STORE %2, %0 :: (store 1, addrspace 1)
275...
276
277---
278name: test_store_global_i8
279body: |
280  bb.0:
281    liveins: $vgpr0_vgpr1, $vgpr2
282
283    ; SI-LABEL: name: test_store_global_i8
284    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
285    ; SI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
286    ; SI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
287    ; SI: G_STORE [[COPY2]](s32), [[COPY]](p1) :: (store 1, addrspace 1)
288    ; VI-LABEL: name: test_store_global_i8
289    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
290    ; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
291    ; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
292    ; VI: G_STORE [[COPY2]](s32), [[COPY]](p1) :: (store 1, addrspace 1)
293    %0:_(p1) = COPY $vgpr0_vgpr1
294    %1:_(s32) = COPY $vgpr2
295    %2:_(s8) = G_TRUNC %1
296    G_STORE %2, %0 :: (store 1, addrspace 1)
297...
298
299---
300name: test_store_global_i16
301body: |
302  bb.0:
303    liveins: $vgpr0_vgpr1, $vgpr2
304
305    ; SI-LABEL: name: test_store_global_i16
306    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
307    ; SI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
308    ; SI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
309    ; SI: G_STORE [[COPY2]](s32), [[COPY]](p1) :: (store 2, addrspace 1)
310    ; VI-LABEL: name: test_store_global_i16
311    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
312    ; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
313    ; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
314    ; VI: G_STORE [[COPY2]](s32), [[COPY]](p1) :: (store 2, addrspace 1)
315    %0:_(p1) = COPY $vgpr0_vgpr1
316    %1:_(s32) = COPY $vgpr2
317    %2:_(s16) = G_TRUNC %1
318    G_STORE %2, %0 :: (store 2, addrspace 1)
319...
320
321---
322name: test_store_global_96
323body: |
324  bb.0:
325    liveins: $vgpr0_vgpr1_vgpr2, $vgpr3_vgpr4
326
327    ; SI-LABEL: name: test_store_global_96
328    ; SI: [[COPY:%[0-9]+]]:_(s96) = COPY $vgpr0_vgpr1_vgpr2
329    ; SI: [[COPY1:%[0-9]+]]:_(p1) = COPY $vgpr3_vgpr4
330    ; SI: [[BITCAST:%[0-9]+]]:_(<3 x s32>) = G_BITCAST [[COPY]](s96)
331    ; SI: [[EXTRACT:%[0-9]+]]:_(<2 x s32>) = G_EXTRACT [[BITCAST]](<3 x s32>), 0
332    ; SI: [[EXTRACT1:%[0-9]+]]:_(s32) = G_EXTRACT [[BITCAST]](<3 x s32>), 64
333    ; SI: G_STORE [[EXTRACT]](<2 x s32>), [[COPY1]](p1) :: (store 8, align 16, addrspace 1)
334    ; SI: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
335    ; SI: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY1]], [[C]](s64)
336    ; SI: G_STORE [[EXTRACT1]](s32), [[PTR_ADD]](p1) :: (store 4 + 8, align 8, addrspace 1)
337    ; VI-LABEL: name: test_store_global_96
338    ; VI: [[COPY:%[0-9]+]]:_(s96) = COPY $vgpr0_vgpr1_vgpr2
339    ; VI: [[COPY1:%[0-9]+]]:_(p1) = COPY $vgpr3_vgpr4
340    ; VI: [[BITCAST:%[0-9]+]]:_(<3 x s32>) = G_BITCAST [[COPY]](s96)
341    ; VI: G_STORE [[BITCAST]](<3 x s32>), [[COPY1]](p1) :: (store 12, align 16, addrspace 1)
342    %0:_(s96) = COPY $vgpr0_vgpr1_vgpr2
343    %1:_(p1) = COPY $vgpr3_vgpr4
344
345    G_STORE %0, %1 :: (store 12, addrspace 1, align 16)
346...
347
348---
349name: test_store_global_i128
350body: |
351  bb.0:
352    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
353
354    ; SI-LABEL: name: test_store_global_i128
355    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
356    ; SI: [[COPY1:%[0-9]+]]:_(s128) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
357    ; SI: [[BITCAST:%[0-9]+]]:_(<4 x s32>) = G_BITCAST [[COPY1]](s128)
358    ; SI: G_STORE [[BITCAST]](<4 x s32>), [[COPY]](p1) :: (store 16, addrspace 1)
359    ; VI-LABEL: name: test_store_global_i128
360    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
361    ; VI: [[COPY1:%[0-9]+]]:_(s128) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
362    ; VI: [[BITCAST:%[0-9]+]]:_(<4 x s32>) = G_BITCAST [[COPY1]](s128)
363    ; VI: G_STORE [[BITCAST]](<4 x s32>), [[COPY]](p1) :: (store 16, addrspace 1)
364    %0:_(p1) = COPY $vgpr0_vgpr1
365    %1:_(s128) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
366    G_STORE %1, %0 :: (store 16, addrspace 1)
367...
368
369---
370name: test_store_global_v2s64
371body: |
372  bb.0:
373    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
374
375    ; SI-LABEL: name: test_store_global_v2s64
376    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
377    ; SI: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
378    ; SI: G_STORE [[COPY1]](<2 x s64>), [[COPY]](p1) :: (store 16, addrspace 1)
379    ; VI-LABEL: name: test_store_global_v2s64
380    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
381    ; VI: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
382    ; VI: G_STORE [[COPY1]](<2 x s64>), [[COPY]](p1) :: (store 16, addrspace 1)
383    %0:_(p1) = COPY $vgpr0_vgpr1
384    %1:_(<2 x s64>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
385    G_STORE %1, %0 :: (store 16, addrspace 1)
386
387...
388
389---
390name: test_store_global_v2s8_align1
391body: |
392  bb.0:
393    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
394
395    ; SI-LABEL: name: test_store_global_v2s8_align1
396    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
397    ; SI: [[DEF:%[0-9]+]]:_(<2 x s32>) = G_IMPLICIT_DEF
398    ; SI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<2 x s32>)
399    ; SI: [[COPY1:%[0-9]+]]:_(s32) = COPY [[UV]](s32)
400    ; SI: G_STORE [[COPY1]](s32), [[COPY]](p1) :: (store 1, addrspace 1)
401    ; SI: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
402    ; SI: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C]](s64)
403    ; SI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
404    ; SI: G_STORE [[COPY2]](s32), [[PTR_ADD]](p1) :: (store 1 + 1, addrspace 1)
405    ; VI-LABEL: name: test_store_global_v2s8_align1
406    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
407    ; VI: [[DEF:%[0-9]+]]:_(<2 x s32>) = G_IMPLICIT_DEF
408    ; VI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<2 x s32>)
409    ; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY [[UV]](s32)
410    ; VI: G_STORE [[COPY1]](s32), [[COPY]](p1) :: (store 1, addrspace 1)
411    ; VI: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
412    ; VI: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C]](s64)
413    ; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
414    ; VI: G_STORE [[COPY2]](s32), [[PTR_ADD]](p1) :: (store 1 + 1, addrspace 1)
415    %0:_(p1) = COPY $vgpr0_vgpr1
416    %1:_(<2 x s8>) = G_IMPLICIT_DEF
417    G_STORE %1, %0 :: (store 2, addrspace 1, align 1)
418
419...
420
421---
422name: test_store_global_v2s8_align2
423body: |
424  bb.0:
425    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
426
427    ; SI-LABEL: name: test_store_global_v2s8_align2
428    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
429    ; SI: [[DEF:%[0-9]+]]:_(<2 x s32>) = G_IMPLICIT_DEF
430    ; SI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<2 x s32>)
431    ; SI: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
432    ; SI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
433    ; SI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
434    ; SI: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
435    ; SI: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
436    ; SI: [[COPY1:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
437    ; SI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
438    ; SI: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32)
439    ; SI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32)
440    ; SI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[TRUNC1]]
441    ; SI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
442    ; SI: G_STORE [[ANYEXT]](s32), [[COPY]](p1) :: (store 2, addrspace 1)
443    ; VI-LABEL: name: test_store_global_v2s8_align2
444    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
445    ; VI: [[DEF:%[0-9]+]]:_(<2 x s32>) = G_IMPLICIT_DEF
446    ; VI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<2 x s32>)
447    ; VI: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
448    ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
449    ; VI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
450    ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[UV1]](s32)
451    ; VI: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[C]]
452    ; VI: [[C1:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
453    ; VI: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[AND1]], [[C1]](s16)
454    ; VI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[SHL]]
455    ; VI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
456    ; VI: G_STORE [[ANYEXT]](s32), [[COPY]](p1) :: (store 2, addrspace 1)
457    %0:_(p1) = COPY $vgpr0_vgpr1
458    %1:_(<2 x s8>) = G_IMPLICIT_DEF
459    G_STORE %1, %0 :: (store 2, addrspace 1, align 2)
460
461...
462
463---
464name: test_store_global_v2s8_align4
465body: |
466  bb.0:
467    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
468
469    ; SI-LABEL: name: test_store_global_v2s8_align4
470    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
471    ; SI: [[DEF:%[0-9]+]]:_(<2 x s32>) = G_IMPLICIT_DEF
472    ; SI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<2 x s32>)
473    ; SI: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
474    ; SI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
475    ; SI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
476    ; SI: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
477    ; SI: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
478    ; SI: [[COPY1:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
479    ; SI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
480    ; SI: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32)
481    ; SI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32)
482    ; SI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[TRUNC1]]
483    ; SI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
484    ; SI: G_STORE [[ANYEXT]](s32), [[COPY]](p1) :: (store 2, align 4, addrspace 1)
485    ; VI-LABEL: name: test_store_global_v2s8_align4
486    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
487    ; VI: [[DEF:%[0-9]+]]:_(<2 x s32>) = G_IMPLICIT_DEF
488    ; VI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<2 x s32>)
489    ; VI: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
490    ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
491    ; VI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
492    ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[UV1]](s32)
493    ; VI: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[C]]
494    ; VI: [[C1:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
495    ; VI: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[AND1]], [[C1]](s16)
496    ; VI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[SHL]]
497    ; VI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
498    ; VI: G_STORE [[ANYEXT]](s32), [[COPY]](p1) :: (store 2, align 4, addrspace 1)
499    %0:_(p1) = COPY $vgpr0_vgpr1
500    %1:_(<2 x s8>) = G_IMPLICIT_DEF
501    G_STORE %1, %0 :: (store 2, addrspace 1, align 4)
502
503...
504
505---
506name: test_store_global_v3s8_align1
507body: |
508  bb.0:
509    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
510
511    ; SI-LABEL: name: test_store_global_v3s8_align1
512    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
513    ; SI: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
514    ; SI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<3 x s32>)
515    ; SI: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[UV2]](s32)
516    ; SI: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
517    ; SI: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
518    ; SI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
519    ; SI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[C]]
520    ; SI: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
521    ; SI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
522    ; SI: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
523    ; SI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
524    ; SI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C2]]
525    ; SI: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[COPY2]](s32)
526    ; SI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32)
527    ; SI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[TRUNC2]]
528    ; SI: [[COPY4:%[0-9]+]]:_(s16) = COPY [[OR]](s16)
529    ; SI: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[COPY4]](s16)
530    ; SI: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[ZEXT]], [[C1]](s32)
531    ; SI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[COPY4]](s16)
532    ; SI: G_STORE [[ANYEXT]](s32), [[COPY]](p1) :: (store 1, addrspace 1)
533    ; SI: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
534    ; SI: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C3]](s64)
535    ; SI: [[COPY5:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
536    ; SI: G_STORE [[COPY5]](s32), [[PTR_ADD]](p1) :: (store 1 + 1, addrspace 1)
537    ; SI: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
538    ; SI: [[PTR_ADD1:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C4]](s64)
539    ; SI: [[COPY6:%[0-9]+]]:_(s32) = COPY [[UV2]](s32)
540    ; SI: G_STORE [[COPY6]](s32), [[PTR_ADD1]](p1) :: (store 1 + 2, addrspace 1)
541    ; VI-LABEL: name: test_store_global_v3s8_align1
542    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
543    ; VI: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
544    ; VI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<3 x s32>)
545    ; VI: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[UV2]](s32)
546    ; VI: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
547    ; VI: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
548    ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
549    ; VI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[C]]
550    ; VI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[UV1]](s32)
551    ; VI: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[C]]
552    ; VI: [[C1:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
553    ; VI: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[AND1]], [[C1]](s16)
554    ; VI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[SHL]]
555    ; VI: [[COPY2:%[0-9]+]]:_(s16) = COPY [[OR]](s16)
556    ; VI: [[LSHR:%[0-9]+]]:_(s16) = G_LSHR [[COPY2]], [[C1]](s16)
557    ; VI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[COPY2]](s16)
558    ; VI: G_STORE [[ANYEXT]](s32), [[COPY]](p1) :: (store 1, addrspace 1)
559    ; VI: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
560    ; VI: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C2]](s64)
561    ; VI: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[LSHR]](s16)
562    ; VI: G_STORE [[ANYEXT1]](s32), [[PTR_ADD]](p1) :: (store 1 + 1, addrspace 1)
563    ; VI: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
564    ; VI: [[PTR_ADD1:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C3]](s64)
565    ; VI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[UV2]](s32)
566    ; VI: G_STORE [[COPY3]](s32), [[PTR_ADD1]](p1) :: (store 1 + 2, addrspace 1)
567    %0:_(p1) = COPY $vgpr0_vgpr1
568    %1:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
569    %2:_(<3 x s8>) = G_TRUNC %1
570    G_STORE %2, %0 :: (store 3, addrspace 1, align 1)
571
572...
573
574---
575name: test_store_global_v3s8_align2
576body: |
577  bb.0:
578    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
579
580    ; SI-LABEL: name: test_store_global_v3s8_align2
581    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
582    ; SI: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
583    ; SI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<3 x s32>)
584    ; SI: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[UV2]](s32)
585    ; SI: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
586    ; SI: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
587    ; SI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
588    ; SI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[C]]
589    ; SI: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
590    ; SI: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
591    ; SI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
592    ; SI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C2]]
593    ; SI: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32)
594    ; SI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32)
595    ; SI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[TRUNC2]]
596    ; SI: [[COPY3:%[0-9]+]]:_(s16) = COPY [[OR]](s16)
597    ; SI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[COPY3]](s16)
598    ; SI: G_STORE [[ANYEXT]](s32), [[COPY]](p1) :: (store 2, addrspace 1)
599    ; SI: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
600    ; SI: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C3]](s64)
601    ; SI: [[COPY4:%[0-9]+]]:_(s32) = COPY [[UV2]](s32)
602    ; SI: G_STORE [[COPY4]](s32), [[PTR_ADD]](p1) :: (store 1 + 2, align 2, addrspace 1)
603    ; VI-LABEL: name: test_store_global_v3s8_align2
604    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
605    ; VI: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
606    ; VI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<3 x s32>)
607    ; VI: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[UV2]](s32)
608    ; VI: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
609    ; VI: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
610    ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
611    ; VI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[C]]
612    ; VI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[UV1]](s32)
613    ; VI: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[C]]
614    ; VI: [[C1:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
615    ; VI: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[AND1]], [[C1]](s16)
616    ; VI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[SHL]]
617    ; VI: [[COPY2:%[0-9]+]]:_(s16) = COPY [[OR]](s16)
618    ; VI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[COPY2]](s16)
619    ; VI: G_STORE [[ANYEXT]](s32), [[COPY]](p1) :: (store 2, addrspace 1)
620    ; VI: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
621    ; VI: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C2]](s64)
622    ; VI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[UV2]](s32)
623    ; VI: G_STORE [[COPY3]](s32), [[PTR_ADD]](p1) :: (store 1 + 2, align 2, addrspace 1)
624    %0:_(p1) = COPY $vgpr0_vgpr1
625    %1:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
626    %2:_(<3 x s8>) = G_TRUNC %1
627    G_STORE %2, %0 :: (store 3, addrspace 1, align 2)
628
629...
630
631---
632name: test_store_global_v3s8_align4
633body: |
634  bb.0:
635    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
636
637    ; SI-LABEL: name: test_store_global_v3s8_align4
638    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
639    ; SI: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
640    ; SI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<3 x s32>)
641    ; SI: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
642    ; SI: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
643    ; SI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
644    ; SI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
645    ; SI: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
646    ; SI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
647    ; SI: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
648    ; SI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
649    ; SI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C2]]
650    ; SI: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[COPY2]](s32)
651    ; SI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32)
652    ; SI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[TRUNC1]]
653    ; SI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[UV2]](s32)
654    ; SI: [[AND2:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[C]]
655    ; SI: [[COPY4:%[0-9]+]]:_(s32) = COPY [[DEF]](s32)
656    ; SI: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C2]]
657    ; SI: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C1]](s32)
658    ; SI: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[SHL1]](s32)
659    ; SI: [[OR1:%[0-9]+]]:_(s16) = G_OR [[AND2]], [[TRUNC3]]
660    ; SI: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[OR]](s16)
661    ; SI: [[ZEXT1:%[0-9]+]]:_(s32) = G_ZEXT [[OR1]](s16)
662    ; SI: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
663    ; SI: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[ZEXT1]], [[C3]](s32)
664    ; SI: [[OR2:%[0-9]+]]:_(s32) = G_OR [[ZEXT]], [[SHL2]]
665    ; SI: [[COPY5:%[0-9]+]]:_(s32) = COPY [[OR2]](s32)
666    ; SI: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY5]], [[C3]](s32)
667    ; SI: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
668    ; SI: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C4]](s64)
669    ; SI: G_STORE [[COPY5]](s32), [[COPY]](p1) :: (store 2, align 4, addrspace 1)
670    ; SI: G_STORE [[LSHR]](s32), [[PTR_ADD]](p1) :: (store 1 + 2, align 2, addrspace 1)
671    ; VI-LABEL: name: test_store_global_v3s8_align4
672    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
673    ; VI: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
674    ; VI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<3 x s32>)
675    ; VI: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
676    ; VI: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
677    ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
678    ; VI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
679    ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[UV1]](s32)
680    ; VI: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[C]]
681    ; VI: [[C1:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
682    ; VI: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[AND1]], [[C1]](s16)
683    ; VI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[SHL]]
684    ; VI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[UV2]](s32)
685    ; VI: [[AND2:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[C]]
686    ; VI: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[DEF]](s32)
687    ; VI: [[AND3:%[0-9]+]]:_(s16) = G_AND [[TRUNC3]], [[C]]
688    ; VI: [[SHL1:%[0-9]+]]:_(s16) = G_SHL [[AND3]], [[C1]](s16)
689    ; VI: [[OR1:%[0-9]+]]:_(s16) = G_OR [[AND2]], [[SHL1]]
690    ; VI: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[OR]](s16)
691    ; VI: [[ZEXT1:%[0-9]+]]:_(s32) = G_ZEXT [[OR1]](s16)
692    ; VI: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
693    ; VI: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[ZEXT1]], [[C2]](s32)
694    ; VI: [[OR2:%[0-9]+]]:_(s32) = G_OR [[ZEXT]], [[SHL2]]
695    ; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[OR2]](s32)
696    ; VI: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY2]], [[C2]](s32)
697    ; VI: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
698    ; VI: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C3]](s64)
699    ; VI: G_STORE [[COPY2]](s32), [[COPY]](p1) :: (store 2, align 4, addrspace 1)
700    ; VI: G_STORE [[LSHR]](s32), [[PTR_ADD]](p1) :: (store 1 + 2, align 2, addrspace 1)
701    %0:_(p1) = COPY $vgpr0_vgpr1
702    %1:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
703    %2:_(<3 x s8>) = G_TRUNC %1
704    G_STORE %2, %0 :: (store 3, addrspace 1, align 4)
705
706...
707
708---
709name: test_store_global_v4s8_align1
710body: |
711  bb.0:
712    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
713
714    ; SI-LABEL: name: test_store_global_v4s8_align1
715    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
716    ; SI: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
717    ; SI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<4 x s32>)
718    ; SI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[UV]](s32)
719    ; SI: G_STORE [[COPY2]](s32), [[COPY]](p1) :: (store 1, addrspace 1)
720    ; SI: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
721    ; SI: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C]](s64)
722    ; SI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
723    ; SI: G_STORE [[COPY3]](s32), [[PTR_ADD]](p1) :: (store 1 + 1, addrspace 1)
724    ; SI: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
725    ; SI: [[PTR_ADD1:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C1]](s64)
726    ; SI: [[COPY4:%[0-9]+]]:_(s32) = COPY [[UV2]](s32)
727    ; SI: G_STORE [[COPY4]](s32), [[PTR_ADD1]](p1) :: (store 1 + 2, addrspace 1)
728    ; SI: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 3
729    ; SI: [[PTR_ADD2:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C2]](s64)
730    ; SI: [[COPY5:%[0-9]+]]:_(s32) = COPY [[UV3]](s32)
731    ; SI: G_STORE [[COPY5]](s32), [[PTR_ADD2]](p1) :: (store 1 + 3, addrspace 1)
732    ; VI-LABEL: name: test_store_global_v4s8_align1
733    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
734    ; VI: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
735    ; VI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<4 x s32>)
736    ; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[UV]](s32)
737    ; VI: G_STORE [[COPY2]](s32), [[COPY]](p1) :: (store 1, addrspace 1)
738    ; VI: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
739    ; VI: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C]](s64)
740    ; VI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
741    ; VI: G_STORE [[COPY3]](s32), [[PTR_ADD]](p1) :: (store 1 + 1, addrspace 1)
742    ; VI: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
743    ; VI: [[PTR_ADD1:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C1]](s64)
744    ; VI: [[COPY4:%[0-9]+]]:_(s32) = COPY [[UV2]](s32)
745    ; VI: G_STORE [[COPY4]](s32), [[PTR_ADD1]](p1) :: (store 1 + 2, addrspace 1)
746    ; VI: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 3
747    ; VI: [[PTR_ADD2:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C2]](s64)
748    ; VI: [[COPY5:%[0-9]+]]:_(s32) = COPY [[UV3]](s32)
749    ; VI: G_STORE [[COPY5]](s32), [[PTR_ADD2]](p1) :: (store 1 + 3, addrspace 1)
750    %0:_(p1) = COPY $vgpr0_vgpr1
751    %1:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
752    %2:_(<4 x s8>) = G_TRUNC %1
753    G_STORE %2, %0 :: (store 4, addrspace 1, align 1)
754
755...
756
757---
758name: test_store_global_v4s8_align2
759body: |
760  bb.0:
761    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
762
763    ; SI-LABEL: name: test_store_global_v4s8_align2
764    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
765    ; SI: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
766    ; SI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<4 x s32>)
767    ; SI: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
768    ; SI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
769    ; SI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
770    ; SI: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
771    ; SI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
772    ; SI: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
773    ; SI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
774    ; SI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C2]]
775    ; SI: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[COPY2]](s32)
776    ; SI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32)
777    ; SI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[TRUNC1]]
778    ; SI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[UV2]](s32)
779    ; SI: [[AND2:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[C]]
780    ; SI: [[COPY4:%[0-9]+]]:_(s32) = COPY [[UV3]](s32)
781    ; SI: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C2]]
782    ; SI: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C1]](s32)
783    ; SI: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[SHL1]](s32)
784    ; SI: [[OR1:%[0-9]+]]:_(s16) = G_OR [[AND2]], [[TRUNC3]]
785    ; SI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
786    ; SI: G_STORE [[ANYEXT]](s32), [[COPY]](p1) :: (store 2, addrspace 1)
787    ; SI: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
788    ; SI: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C3]](s64)
789    ; SI: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[OR1]](s16)
790    ; SI: G_STORE [[ANYEXT1]](s32), [[PTR_ADD]](p1) :: (store 2 + 2, addrspace 1)
791    ; VI-LABEL: name: test_store_global_v4s8_align2
792    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
793    ; VI: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
794    ; VI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<4 x s32>)
795    ; VI: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
796    ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
797    ; VI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
798    ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[UV1]](s32)
799    ; VI: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[C]]
800    ; VI: [[C1:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
801    ; VI: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[AND1]], [[C1]](s16)
802    ; VI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[SHL]]
803    ; VI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[UV2]](s32)
804    ; VI: [[AND2:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[C]]
805    ; VI: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[UV3]](s32)
806    ; VI: [[AND3:%[0-9]+]]:_(s16) = G_AND [[TRUNC3]], [[C]]
807    ; VI: [[SHL1:%[0-9]+]]:_(s16) = G_SHL [[AND3]], [[C1]](s16)
808    ; VI: [[OR1:%[0-9]+]]:_(s16) = G_OR [[AND2]], [[SHL1]]
809    ; VI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
810    ; VI: G_STORE [[ANYEXT]](s32), [[COPY]](p1) :: (store 2, addrspace 1)
811    ; VI: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
812    ; VI: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C2]](s64)
813    ; VI: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[OR1]](s16)
814    ; VI: G_STORE [[ANYEXT1]](s32), [[PTR_ADD]](p1) :: (store 2 + 2, addrspace 1)
815    %0:_(p1) = COPY $vgpr0_vgpr1
816    %1:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
817    %2:_(<4 x s8>) = G_TRUNC %1
818    G_STORE %2, %0 :: (store 4, addrspace 1, align 2)
819
820...
821
822---
823name: test_store_global_v4s8_align4
824body: |
825  bb.0:
826    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
827
828    ; SI-LABEL: name: test_store_global_v4s8_align4
829    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
830    ; SI: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
831    ; SI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<4 x s32>)
832    ; SI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
833    ; SI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[UV]](s32)
834    ; SI: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
835    ; SI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
836    ; SI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C]]
837    ; SI: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
838    ; SI: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32)
839    ; SI: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]]
840    ; SI: [[COPY4:%[0-9]+]]:_(s32) = COPY [[UV2]](s32)
841    ; SI: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C]]
842    ; SI: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
843    ; SI: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND2]], [[C2]](s32)
844    ; SI: [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]]
845    ; SI: [[COPY5:%[0-9]+]]:_(s32) = COPY [[UV3]](s32)
846    ; SI: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY5]], [[C]]
847    ; SI: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
848    ; SI: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C3]](s32)
849    ; SI: [[OR2:%[0-9]+]]:_(s32) = G_OR [[OR1]], [[SHL2]]
850    ; SI: G_STORE [[OR2]](s32), [[COPY]](p1) :: (store 4, addrspace 1)
851    ; VI-LABEL: name: test_store_global_v4s8_align4
852    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
853    ; VI: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
854    ; VI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<4 x s32>)
855    ; VI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
856    ; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[UV]](s32)
857    ; VI: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
858    ; VI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
859    ; VI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C]]
860    ; VI: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
861    ; VI: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32)
862    ; VI: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]]
863    ; VI: [[COPY4:%[0-9]+]]:_(s32) = COPY [[UV2]](s32)
864    ; VI: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C]]
865    ; VI: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
866    ; VI: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND2]], [[C2]](s32)
867    ; VI: [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]]
868    ; VI: [[COPY5:%[0-9]+]]:_(s32) = COPY [[UV3]](s32)
869    ; VI: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY5]], [[C]]
870    ; VI: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
871    ; VI: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C3]](s32)
872    ; VI: [[OR2:%[0-9]+]]:_(s32) = G_OR [[OR1]], [[SHL2]]
873    ; VI: G_STORE [[OR2]](s32), [[COPY]](p1) :: (store 4, addrspace 1)
874    %0:_(p1) = COPY $vgpr0_vgpr1
875    %1:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
876    %2:_(<4 x s8>) = G_TRUNC %1
877    G_STORE %2, %0 :: (store 4, addrspace 1, align 4)
878
879...
880
881---
882name: test_truncstore_global_v2s8_to_1_align1
883body: |
884  bb.0:
885    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
886
887    ; SI-LABEL: name: test_truncstore_global_v2s8_to_1_align1
888    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
889    ; SI: [[DEF:%[0-9]+]]:_(<2 x s32>) = G_IMPLICIT_DEF
890    ; SI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<2 x s32>)
891    ; SI: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
892    ; SI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
893    ; SI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
894    ; SI: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
895    ; SI: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
896    ; SI: [[COPY1:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
897    ; SI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
898    ; SI: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32)
899    ; SI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32)
900    ; SI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[TRUNC1]]
901    ; SI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
902    ; SI: G_STORE [[ANYEXT]](s32), [[COPY]](p1) :: (store 1, addrspace 1)
903    ; VI-LABEL: name: test_truncstore_global_v2s8_to_1_align1
904    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
905    ; VI: [[DEF:%[0-9]+]]:_(<2 x s32>) = G_IMPLICIT_DEF
906    ; VI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<2 x s32>)
907    ; VI: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
908    ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
909    ; VI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
910    ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[UV1]](s32)
911    ; VI: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[C]]
912    ; VI: [[C1:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
913    ; VI: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[AND1]], [[C1]](s16)
914    ; VI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[SHL]]
915    ; VI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
916    ; VI: G_STORE [[ANYEXT]](s32), [[COPY]](p1) :: (store 1, addrspace 1)
917    %0:_(p1) = COPY $vgpr0_vgpr1
918    %1:_(<2 x s8>) = G_IMPLICIT_DEF
919    G_STORE %1, %0 :: (store 1, addrspace 1, align 1)
920
921...
922
923---
924name: test_truncstore_global_v3s8_to_1_align1
925body: |
926  bb.0:
927    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
928
929    ; SI-LABEL: name: test_truncstore_global_v3s8_to_1_align1
930    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
931    ; SI: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
932    ; SI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<3 x s32>)
933    ; SI: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
934    ; SI: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
935    ; SI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
936    ; SI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
937    ; SI: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
938    ; SI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
939    ; SI: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
940    ; SI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
941    ; SI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C2]]
942    ; SI: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[COPY2]](s32)
943    ; SI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32)
944    ; SI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[TRUNC1]]
945    ; SI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[UV2]](s32)
946    ; SI: [[AND2:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[C]]
947    ; SI: [[COPY4:%[0-9]+]]:_(s32) = COPY [[DEF]](s32)
948    ; SI: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C2]]
949    ; SI: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C1]](s32)
950    ; SI: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[SHL1]](s32)
951    ; SI: [[OR1:%[0-9]+]]:_(s16) = G_OR [[AND2]], [[TRUNC3]]
952    ; SI: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[OR]](s16)
953    ; SI: [[ZEXT1:%[0-9]+]]:_(s32) = G_ZEXT [[OR1]](s16)
954    ; SI: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
955    ; SI: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[ZEXT1]], [[C3]](s32)
956    ; SI: [[OR2:%[0-9]+]]:_(s32) = G_OR [[ZEXT]], [[SHL2]]
957    ; SI: [[COPY5:%[0-9]+]]:_(s32) = COPY [[OR2]](s32)
958    ; SI: G_STORE [[COPY5]](s32), [[COPY]](p1) :: (store 1, addrspace 1)
959    ; VI-LABEL: name: test_truncstore_global_v3s8_to_1_align1
960    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
961    ; VI: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
962    ; VI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<3 x s32>)
963    ; VI: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
964    ; VI: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
965    ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
966    ; VI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
967    ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[UV1]](s32)
968    ; VI: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[C]]
969    ; VI: [[C1:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
970    ; VI: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[AND1]], [[C1]](s16)
971    ; VI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[SHL]]
972    ; VI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[UV2]](s32)
973    ; VI: [[AND2:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[C]]
974    ; VI: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[DEF]](s32)
975    ; VI: [[AND3:%[0-9]+]]:_(s16) = G_AND [[TRUNC3]], [[C]]
976    ; VI: [[SHL1:%[0-9]+]]:_(s16) = G_SHL [[AND3]], [[C1]](s16)
977    ; VI: [[OR1:%[0-9]+]]:_(s16) = G_OR [[AND2]], [[SHL1]]
978    ; VI: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[OR]](s16)
979    ; VI: [[ZEXT1:%[0-9]+]]:_(s32) = G_ZEXT [[OR1]](s16)
980    ; VI: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
981    ; VI: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[ZEXT1]], [[C2]](s32)
982    ; VI: [[OR2:%[0-9]+]]:_(s32) = G_OR [[ZEXT]], [[SHL2]]
983    ; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[OR2]](s32)
984    ; VI: G_STORE [[COPY2]](s32), [[COPY]](p1) :: (store 1, addrspace 1)
985    %0:_(p1) = COPY $vgpr0_vgpr1
986    %1:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
987    %2:_(<3 x s8>) = G_TRUNC %1
988    G_STORE %2, %0 :: (store 1, addrspace 1, align 1)
989
990...
991
992---
993name: test_truncstore_global_v3s8_to_2_align2
994body: |
995  bb.0:
996    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
997
998    ; SI-LABEL: name: test_truncstore_global_v3s8_to_2_align2
999    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
1000    ; SI: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
1001    ; SI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<3 x s32>)
1002    ; SI: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
1003    ; SI: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
1004    ; SI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
1005    ; SI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
1006    ; SI: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
1007    ; SI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
1008    ; SI: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
1009    ; SI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
1010    ; SI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C2]]
1011    ; SI: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[COPY2]](s32)
1012    ; SI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32)
1013    ; SI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[TRUNC1]]
1014    ; SI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[UV2]](s32)
1015    ; SI: [[AND2:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[C]]
1016    ; SI: [[COPY4:%[0-9]+]]:_(s32) = COPY [[DEF]](s32)
1017    ; SI: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C2]]
1018    ; SI: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C1]](s32)
1019    ; SI: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[SHL1]](s32)
1020    ; SI: [[OR1:%[0-9]+]]:_(s16) = G_OR [[AND2]], [[TRUNC3]]
1021    ; SI: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[OR]](s16)
1022    ; SI: [[ZEXT1:%[0-9]+]]:_(s32) = G_ZEXT [[OR1]](s16)
1023    ; SI: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
1024    ; SI: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[ZEXT1]], [[C3]](s32)
1025    ; SI: [[OR2:%[0-9]+]]:_(s32) = G_OR [[ZEXT]], [[SHL2]]
1026    ; SI: [[COPY5:%[0-9]+]]:_(s32) = COPY [[OR2]](s32)
1027    ; SI: G_STORE [[COPY5]](s32), [[COPY]](p1) :: (store 2, addrspace 1)
1028    ; VI-LABEL: name: test_truncstore_global_v3s8_to_2_align2
1029    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
1030    ; VI: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
1031    ; VI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<3 x s32>)
1032    ; VI: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
1033    ; VI: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
1034    ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
1035    ; VI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
1036    ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[UV1]](s32)
1037    ; VI: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[C]]
1038    ; VI: [[C1:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
1039    ; VI: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[AND1]], [[C1]](s16)
1040    ; VI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[SHL]]
1041    ; VI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[UV2]](s32)
1042    ; VI: [[AND2:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[C]]
1043    ; VI: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[DEF]](s32)
1044    ; VI: [[AND3:%[0-9]+]]:_(s16) = G_AND [[TRUNC3]], [[C]]
1045    ; VI: [[SHL1:%[0-9]+]]:_(s16) = G_SHL [[AND3]], [[C1]](s16)
1046    ; VI: [[OR1:%[0-9]+]]:_(s16) = G_OR [[AND2]], [[SHL1]]
1047    ; VI: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[OR]](s16)
1048    ; VI: [[ZEXT1:%[0-9]+]]:_(s32) = G_ZEXT [[OR1]](s16)
1049    ; VI: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
1050    ; VI: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[ZEXT1]], [[C2]](s32)
1051    ; VI: [[OR2:%[0-9]+]]:_(s32) = G_OR [[ZEXT]], [[SHL2]]
1052    ; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[OR2]](s32)
1053    ; VI: G_STORE [[COPY2]](s32), [[COPY]](p1) :: (store 2, addrspace 1)
1054    %0:_(p1) = COPY $vgpr0_vgpr1
1055    %1:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
1056    %2:_(<3 x s8>) = G_TRUNC %1
1057    G_STORE %2, %0 :: (store 2, addrspace 1, align 2)
1058
1059...
1060
1061
1062---
1063name: test_truncstore_global_v4s8_to_3_align1
1064body: |
1065  bb.0:
1066    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
1067
1068    ; SI-LABEL: name: test_truncstore_global_v4s8_to_3_align1
1069    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
1070    ; SI: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
1071    ; SI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<4 x s32>)
1072    ; SI: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[UV2]](s32)
1073    ; SI: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
1074    ; SI: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
1075    ; SI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
1076    ; SI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[C]]
1077    ; SI: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
1078    ; SI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
1079    ; SI: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
1080    ; SI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
1081    ; SI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C2]]
1082    ; SI: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[COPY2]](s32)
1083    ; SI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32)
1084    ; SI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[TRUNC2]]
1085    ; SI: [[COPY4:%[0-9]+]]:_(s16) = COPY [[OR]](s16)
1086    ; SI: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[COPY4]](s16)
1087    ; SI: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[ZEXT]], [[C1]](s32)
1088    ; SI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[COPY4]](s16)
1089    ; SI: G_STORE [[ANYEXT]](s32), [[COPY]](p1) :: (store 1, addrspace 1)
1090    ; SI: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
1091    ; SI: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C3]](s64)
1092    ; SI: [[COPY5:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
1093    ; SI: G_STORE [[COPY5]](s32), [[PTR_ADD]](p1) :: (store 1 + 1, addrspace 1)
1094    ; SI: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
1095    ; SI: [[PTR_ADD1:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C4]](s64)
1096    ; SI: [[COPY6:%[0-9]+]]:_(s32) = COPY [[UV2]](s32)
1097    ; SI: G_STORE [[COPY6]](s32), [[PTR_ADD1]](p1) :: (store 1 + 2, addrspace 1)
1098    ; VI-LABEL: name: test_truncstore_global_v4s8_to_3_align1
1099    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
1100    ; VI: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
1101    ; VI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<4 x s32>)
1102    ; VI: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[UV2]](s32)
1103    ; VI: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
1104    ; VI: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
1105    ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
1106    ; VI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[C]]
1107    ; VI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[UV1]](s32)
1108    ; VI: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[C]]
1109    ; VI: [[C1:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
1110    ; VI: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[AND1]], [[C1]](s16)
1111    ; VI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[SHL]]
1112    ; VI: [[COPY2:%[0-9]+]]:_(s16) = COPY [[OR]](s16)
1113    ; VI: [[LSHR:%[0-9]+]]:_(s16) = G_LSHR [[COPY2]], [[C1]](s16)
1114    ; VI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[COPY2]](s16)
1115    ; VI: G_STORE [[ANYEXT]](s32), [[COPY]](p1) :: (store 1, addrspace 1)
1116    ; VI: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
1117    ; VI: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C2]](s64)
1118    ; VI: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[LSHR]](s16)
1119    ; VI: G_STORE [[ANYEXT1]](s32), [[PTR_ADD]](p1) :: (store 1 + 1, addrspace 1)
1120    ; VI: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
1121    ; VI: [[PTR_ADD1:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C3]](s64)
1122    ; VI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[UV2]](s32)
1123    ; VI: G_STORE [[COPY3]](s32), [[PTR_ADD1]](p1) :: (store 1 + 2, addrspace 1)
1124    %0:_(p1) = COPY $vgpr0_vgpr1
1125    %1:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
1126    %2:_(<4 x s8>) = G_TRUNC %1
1127    G_STORE %2, %0 :: (store 3, addrspace 1, align 1)
1128
1129...
1130
1131---
1132name: test_truncstore_global_v4s8_to_3_align2
1133body: |
1134  bb.0:
1135    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
1136
1137    ; SI-LABEL: name: test_truncstore_global_v4s8_to_3_align2
1138    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
1139    ; SI: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
1140    ; SI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<4 x s32>)
1141    ; SI: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[UV2]](s32)
1142    ; SI: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
1143    ; SI: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
1144    ; SI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
1145    ; SI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[C]]
1146    ; SI: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
1147    ; SI: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
1148    ; SI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
1149    ; SI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C2]]
1150    ; SI: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32)
1151    ; SI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32)
1152    ; SI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[TRUNC2]]
1153    ; SI: [[COPY3:%[0-9]+]]:_(s16) = COPY [[OR]](s16)
1154    ; SI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[COPY3]](s16)
1155    ; SI: G_STORE [[ANYEXT]](s32), [[COPY]](p1) :: (store 2, addrspace 1)
1156    ; SI: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
1157    ; SI: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C3]](s64)
1158    ; SI: [[COPY4:%[0-9]+]]:_(s32) = COPY [[UV2]](s32)
1159    ; SI: G_STORE [[COPY4]](s32), [[PTR_ADD]](p1) :: (store 1 + 2, align 2, addrspace 1)
1160    ; VI-LABEL: name: test_truncstore_global_v4s8_to_3_align2
1161    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
1162    ; VI: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
1163    ; VI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<4 x s32>)
1164    ; VI: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[UV2]](s32)
1165    ; VI: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
1166    ; VI: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
1167    ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
1168    ; VI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[C]]
1169    ; VI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[UV1]](s32)
1170    ; VI: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[C]]
1171    ; VI: [[C1:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
1172    ; VI: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[AND1]], [[C1]](s16)
1173    ; VI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[SHL]]
1174    ; VI: [[COPY2:%[0-9]+]]:_(s16) = COPY [[OR]](s16)
1175    ; VI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[COPY2]](s16)
1176    ; VI: G_STORE [[ANYEXT]](s32), [[COPY]](p1) :: (store 2, addrspace 1)
1177    ; VI: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
1178    ; VI: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C2]](s64)
1179    ; VI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[UV2]](s32)
1180    ; VI: G_STORE [[COPY3]](s32), [[PTR_ADD]](p1) :: (store 1 + 2, align 2, addrspace 1)
1181    %0:_(p1) = COPY $vgpr0_vgpr1
1182    %1:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
1183    %2:_(<4 x s8>) = G_TRUNC %1
1184    G_STORE %2, %0 :: (store 3, addrspace 1, align 2)
1185
1186...
1187
1188---
1189name: test_truncstore_global_v4s8_to_3_align4
1190body: |
1191  bb.0:
1192    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
1193
1194    ; SI-LABEL: name: test_truncstore_global_v4s8_to_3_align4
1195    ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
1196    ; SI: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
1197    ; SI: [[TRUNC:%[0-9]+]]:_(<4 x s8>) = G_TRUNC [[COPY1]](<4 x s32>)
1198    ; SI: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[TRUNC]](<4 x s8>)
1199    ; SI: G_STORE [[BITCAST]](s32), [[COPY]](p1) :: (store 3, align 4, addrspace 1)
1200    ; VI-LABEL: name: test_truncstore_global_v4s8_to_3_align4
1201    ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
1202    ; VI: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
1203    ; VI: [[TRUNC:%[0-9]+]]:_(<4 x s8>) = G_TRUNC [[COPY1]](<4 x s32>)
1204    ; VI: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[TRUNC]](<4 x s8>)
1205    ; VI: G_STORE [[BITCAST]](s32), [[COPY]](p1) :: (store 3, align 4, addrspace 1)
1206    %0:_(p1) = COPY $vgpr0_vgpr1
1207    %1:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
1208    %2:_(<4 x s8>) = G_TRUNC %1
1209    G_STORE %2, %0 :: (store 3, addrspace 1, align 4)
1210
1211...
1212