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 -pass-remarks-missed='gisel.*' -o - %s 2> %t.err | FileCheck -check-prefix=SI %s
3 # RUN: FileCheck -check-prefix=ERR %s < %t.err
4 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -O0 -run-pass=legalizer -global-isel-abort=0 -pass-remarks-missed='gisel.*' %s -o - 2> %t.err | FileCheck -check-prefix=VI %s
5 # RUN: FileCheck -check-prefix=ERR %s < %t.err
8 # ERR: remark: <unknown>:0:0: unable to legalize instruction: G_STORE %1:_(<2 x s8>), %0:_(p1) :: (store (<2 x s4>), addrspace 1) (in function: test_truncstore_global_v2s8_to_1_align1)
9 # ERR-NEXT: remark: <unknown>:0:0: unable to legalize instruction: G_STORE %2:_(<3 x s8>), %0:_(p1) :: (store (<3 x s2>), addrspace 1) (in function: test_truncstore_global_v3s8_to_1_align1)
10 # ERR-NEXT: remark: <unknown>:0:0: unable to legalize instruction: G_STORE %2:_(<3 x s8>), %0:_(p1) :: (store (<3 x s4>), addrspace 1) (in function: test_truncstore_global_v3s8_to_2_align2)
14 name: test_store_global_i32
17 liveins: $vgpr0_vgpr1, $vgpr2
19 ; SI-LABEL: name: test_store_global_i32
20 ; SI: liveins: $vgpr0_vgpr1, $vgpr2
22 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
23 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
24 ; SI-NEXT: G_STORE [[COPY1]](s32), [[COPY]](p1) :: (store (s32), addrspace 1)
25 ; VI-LABEL: name: test_store_global_i32
26 ; VI: liveins: $vgpr0_vgpr1, $vgpr2
28 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
29 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
30 ; VI-NEXT: G_STORE [[COPY1]](s32), [[COPY]](p1) :: (store (s32), addrspace 1)
31 %0:_(p1) = COPY $vgpr0_vgpr1
32 %1:_(s32) = COPY $vgpr2
33 G_STORE %1, %0 :: (store (s32), addrspace 1)
37 name: test_store_global_i64
40 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
42 ; SI-LABEL: name: test_store_global_i64
43 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
45 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
46 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
47 ; SI-NEXT: G_STORE [[COPY1]](s64), [[COPY]](p1) :: (store (s64), addrspace 1)
48 ; VI-LABEL: name: test_store_global_i64
49 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
51 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
52 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
53 ; VI-NEXT: G_STORE [[COPY1]](s64), [[COPY]](p1) :: (store (s64), addrspace 1)
54 %0:_(p1) = COPY $vgpr0_vgpr1
55 %1:_(s64) = COPY $vgpr2_vgpr3
56 G_STORE %1, %0 :: (store (s64), addrspace 1)
60 name: test_store_global_p1
63 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
65 ; SI-LABEL: name: test_store_global_p1
66 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
68 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
69 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(p1) = COPY $vgpr2_vgpr3
70 ; SI-NEXT: G_STORE [[COPY1]](p1), [[COPY]](p1) :: (store (p1), addrspace 1)
71 ; VI-LABEL: name: test_store_global_p1
72 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
74 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
75 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(p1) = COPY $vgpr2_vgpr3
76 ; VI-NEXT: G_STORE [[COPY1]](p1), [[COPY]](p1) :: (store (p1), addrspace 1)
77 %0:_(p1) = COPY $vgpr0_vgpr1
78 %1:_(p1) = COPY $vgpr2_vgpr3
79 G_STORE %1, %0 :: (store (p1), addrspace 1)
83 name: test_store_global_p4
86 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
88 ; SI-LABEL: name: test_store_global_p4
89 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
91 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
92 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(p4) = COPY $vgpr2_vgpr3
93 ; SI-NEXT: G_STORE [[COPY1]](p4), [[COPY]](p1) :: (store (p4), addrspace 1)
94 ; VI-LABEL: name: test_store_global_p4
95 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
97 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
98 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(p4) = COPY $vgpr2_vgpr3
99 ; VI-NEXT: G_STORE [[COPY1]](p4), [[COPY]](p1) :: (store (p4), addrspace 1)
100 %0:_(p1) = COPY $vgpr0_vgpr1
101 %1:_(p4) = COPY $vgpr2_vgpr3
102 G_STORE %1, %0 :: (store (p4), addrspace 1)
106 name: test_store_global_p3
109 liveins: $vgpr0_vgpr1, $vgpr2
111 ; SI-LABEL: name: test_store_global_p3
112 ; SI: liveins: $vgpr0_vgpr1, $vgpr2
114 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
115 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(p3) = COPY $vgpr2
116 ; SI-NEXT: G_STORE [[COPY1]](p3), [[COPY]](p1) :: (store (p3), addrspace 1)
117 ; VI-LABEL: name: test_store_global_p3
118 ; VI: liveins: $vgpr0_vgpr1, $vgpr2
120 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
121 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(p3) = COPY $vgpr2
122 ; VI-NEXT: G_STORE [[COPY1]](p3), [[COPY]](p1) :: (store (p3), addrspace 1)
123 %0:_(p1) = COPY $vgpr0_vgpr1
124 %1:_(p3) = COPY $vgpr2
125 G_STORE %1, %0 :: (store (p3), addrspace 1)
129 name: test_store_global_v2s32
132 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
134 ; SI-LABEL: name: test_store_global_v2s32
135 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
137 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
138 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
139 ; SI-NEXT: G_STORE [[COPY1]](<2 x s32>), [[COPY]](p1) :: (store (<2 x s32>), addrspace 1)
140 ; VI-LABEL: name: test_store_global_v2s32
141 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
143 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
144 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
145 ; VI-NEXT: G_STORE [[COPY1]](<2 x s32>), [[COPY]](p1) :: (store (<2 x s32>), addrspace 1)
146 %0:_(p1) = COPY $vgpr0_vgpr1
147 %1:_(<2 x s32>) = COPY $vgpr2_vgpr3
148 G_STORE %1, %0 :: (store (<2 x s32>), addrspace 1)
152 name: test_store_global_v2s16
155 liveins: $vgpr0_vgpr1, $vgpr2
157 ; SI-LABEL: name: test_store_global_v2s16
158 ; SI: liveins: $vgpr0_vgpr1, $vgpr2
160 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
161 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr2
162 ; SI-NEXT: G_STORE [[COPY1]](<2 x s16>), [[COPY]](p1) :: (store (<2 x s16>), addrspace 1)
163 ; VI-LABEL: name: test_store_global_v2s16
164 ; VI: liveins: $vgpr0_vgpr1, $vgpr2
166 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
167 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr2
168 ; VI-NEXT: G_STORE [[COPY1]](<2 x s16>), [[COPY]](p1) :: (store (<2 x s16>), addrspace 1)
169 %0:_(p1) = COPY $vgpr0_vgpr1
170 %1:_(<2 x s16>) = COPY $vgpr2
171 G_STORE %1, %0 :: (store (<2 x s16>), addrspace 1)
175 name: test_store_global_v3s32
178 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
180 ; SI-LABEL: name: test_store_global_v3s32
181 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
183 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
184 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
185 ; SI-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<3 x s32>)
186 ; SI-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[UV]](s32), [[UV1]](s32)
187 ; SI-NEXT: G_STORE [[BUILD_VECTOR]](<2 x s32>), [[COPY]](p1) :: (store (<2 x s32>), align 4, addrspace 1)
188 ; SI-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
189 ; SI-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C]](s64)
190 ; SI-NEXT: G_STORE [[UV2]](s32), [[PTR_ADD]](p1) :: (store (s32) into unknown-address + 8, addrspace 1)
191 ; VI-LABEL: name: test_store_global_v3s32
192 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
194 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
195 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
196 ; VI-NEXT: G_STORE [[COPY1]](<3 x s32>), [[COPY]](p1) :: (store (<3 x s32>), align 4, addrspace 1)
197 %0:_(p1) = COPY $vgpr0_vgpr1
198 %1:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
199 G_STORE %1, %0 :: (store (<3 x s32>), align 4, addrspace 1)
203 name: test_truncstore_global_s64_to_s8
206 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
208 ; SI-LABEL: name: test_truncstore_global_s64_to_s8
209 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
211 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
212 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
213 ; SI-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
214 ; SI-NEXT: G_STORE [[TRUNC]](s32), [[COPY]](p1) :: (store (s8), addrspace 1)
215 ; VI-LABEL: name: test_truncstore_global_s64_to_s8
216 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
218 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
219 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
220 ; VI-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
221 ; VI-NEXT: G_STORE [[TRUNC]](s32), [[COPY]](p1) :: (store (s8), addrspace 1)
222 %0:_(p1) = COPY $vgpr0_vgpr1
223 %1:_(s64) = COPY $vgpr2_vgpr3
224 G_STORE %1, %0 :: (store (s8), addrspace 1)
228 name: test_truncstore_global_s64_to_s16
231 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
233 ; SI-LABEL: name: test_truncstore_global_s64_to_s16
234 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
236 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
237 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
238 ; SI-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
239 ; SI-NEXT: G_STORE [[TRUNC]](s32), [[COPY]](p1) :: (store (s16), addrspace 1)
240 ; VI-LABEL: name: test_truncstore_global_s64_to_s16
241 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
243 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
244 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
245 ; VI-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
246 ; VI-NEXT: G_STORE [[TRUNC]](s32), [[COPY]](p1) :: (store (s16), addrspace 1)
247 %0:_(p1) = COPY $vgpr0_vgpr1
248 %1:_(s64) = COPY $vgpr2_vgpr3
249 G_STORE %1, %0 :: (store (s16), addrspace 1)
253 name: test_truncstore_global_s64_to_s16_align1
256 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
258 ; SI-LABEL: name: test_truncstore_global_s64_to_s16_align1
259 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
261 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
262 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
263 ; SI-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
264 ; SI-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
265 ; SI-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
266 ; SI-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[TRUNC]], [[C1]]
267 ; SI-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[C]](s32)
268 ; SI-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
269 ; SI-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C2]](s64)
270 ; SI-NEXT: G_STORE [[TRUNC]](s32), [[COPY]](p1) :: (store (s8), addrspace 1)
271 ; SI-NEXT: G_STORE [[LSHR]](s32), [[PTR_ADD]](p1) :: (store (s8) into unknown-address + 1, addrspace 1)
272 ; VI-LABEL: name: test_truncstore_global_s64_to_s16_align1
273 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
275 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
276 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
277 ; VI-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
278 ; VI-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s64)
279 ; VI-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
280 ; VI-NEXT: [[LSHR:%[0-9]+]]:_(s16) = G_LSHR [[TRUNC1]], [[C]](s16)
281 ; VI-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
282 ; VI-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C1]](s64)
283 ; VI-NEXT: G_STORE [[TRUNC]](s32), [[COPY]](p1) :: (store (s8), addrspace 1)
284 ; VI-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[LSHR]](s16)
285 ; VI-NEXT: G_STORE [[ANYEXT]](s32), [[PTR_ADD]](p1) :: (store (s8) into unknown-address + 1, addrspace 1)
286 %0:_(p1) = COPY $vgpr0_vgpr1
287 %1:_(s64) = COPY $vgpr2_vgpr3
288 G_STORE %1, %0 :: (store (s16), addrspace 1, align 1)
292 name: test_truncstore_global_s64_to_s32
295 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
297 ; SI-LABEL: name: test_truncstore_global_s64_to_s32
298 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
300 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
301 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
302 ; SI-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
303 ; SI-NEXT: G_STORE [[TRUNC]](s32), [[COPY]](p1) :: (store (s32), addrspace 1)
304 ; VI-LABEL: name: test_truncstore_global_s64_to_s32
305 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
307 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
308 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
309 ; VI-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
310 ; VI-NEXT: G_STORE [[TRUNC]](s32), [[COPY]](p1) :: (store (s32), addrspace 1)
311 %0:_(p1) = COPY $vgpr0_vgpr1
312 %1:_(s64) = COPY $vgpr2_vgpr3
313 G_STORE %1, %0 :: (store (s32), addrspace 1)
317 name: test_truncstore_global_s64_to_s32_align2
320 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
322 ; SI-LABEL: name: test_truncstore_global_s64_to_s32_align2
323 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
325 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
326 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
327 ; SI-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
328 ; SI-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[TRUNC]](s32)
329 ; SI-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
330 ; SI-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY2]], [[C]](s32)
331 ; SI-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
332 ; SI-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C1]](s64)
333 ; SI-NEXT: G_STORE [[COPY2]](s32), [[COPY]](p1) :: (store (s16), addrspace 1)
334 ; SI-NEXT: G_STORE [[LSHR]](s32), [[PTR_ADD]](p1) :: (store (s16) into unknown-address + 2, addrspace 1)
335 ; VI-LABEL: name: test_truncstore_global_s64_to_s32_align2
336 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
338 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
339 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
340 ; VI-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
341 ; VI-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[TRUNC]](s32)
342 ; VI-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
343 ; VI-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY2]], [[C]](s32)
344 ; VI-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
345 ; VI-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C1]](s64)
346 ; VI-NEXT: G_STORE [[COPY2]](s32), [[COPY]](p1) :: (store (s16), addrspace 1)
347 ; VI-NEXT: G_STORE [[LSHR]](s32), [[PTR_ADD]](p1) :: (store (s16) into unknown-address + 2, addrspace 1)
348 %0:_(p1) = COPY $vgpr0_vgpr1
349 %1:_(s64) = COPY $vgpr2_vgpr3
350 G_STORE %1, %0 :: (store (s32), addrspace 1, align 2)
354 name: test_truncstore_global_s64_to_s32_align1
357 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
359 ; SI-LABEL: name: test_truncstore_global_s64_to_s32_align1
360 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
362 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
363 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
364 ; SI-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
365 ; SI-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[TRUNC]](s32)
366 ; SI-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
367 ; SI-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY2]], [[C]](s32)
368 ; SI-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
369 ; SI-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C1]](s64)
370 ; SI-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
371 ; SI-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
372 ; SI-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C3]]
373 ; SI-NEXT: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[C2]](s32)
374 ; SI-NEXT: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
375 ; SI-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C4]](s64)
376 ; SI-NEXT: G_STORE [[COPY2]](s32), [[COPY]](p1) :: (store (s8), addrspace 1)
377 ; SI-NEXT: G_STORE [[LSHR1]](s32), [[PTR_ADD1]](p1) :: (store (s8) into unknown-address + 1, addrspace 1)
378 ; SI-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C2]](s32)
379 ; SI-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[LSHR]], [[C3]]
380 ; SI-NEXT: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[AND1]], [[COPY3]](s32)
381 ; SI-NEXT: [[PTR_ADD2:%[0-9]+]]:_(p1) = G_PTR_ADD [[PTR_ADD]], [[C4]](s64)
382 ; SI-NEXT: G_STORE [[LSHR]](s32), [[PTR_ADD]](p1) :: (store (s8) into unknown-address + 2, addrspace 1)
383 ; SI-NEXT: G_STORE [[LSHR2]](s32), [[PTR_ADD2]](p1) :: (store (s8) into unknown-address + 3, addrspace 1)
384 ; VI-LABEL: name: test_truncstore_global_s64_to_s32_align1
385 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
387 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
388 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
389 ; VI-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
390 ; VI-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[TRUNC]](s32)
391 ; VI-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
392 ; VI-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY2]], [[C]](s32)
393 ; VI-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
394 ; VI-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C1]](s64)
395 ; VI-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s64)
396 ; VI-NEXT: [[C2:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
397 ; VI-NEXT: [[LSHR1:%[0-9]+]]:_(s16) = G_LSHR [[TRUNC1]], [[C2]](s16)
398 ; VI-NEXT: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
399 ; VI-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C3]](s64)
400 ; VI-NEXT: G_STORE [[COPY2]](s32), [[COPY]](p1) :: (store (s8), addrspace 1)
401 ; VI-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[LSHR1]](s16)
402 ; VI-NEXT: G_STORE [[ANYEXT]](s32), [[PTR_ADD1]](p1) :: (store (s8) into unknown-address + 1, addrspace 1)
403 ; VI-NEXT: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32)
404 ; VI-NEXT: [[LSHR2:%[0-9]+]]:_(s16) = G_LSHR [[TRUNC2]], [[C2]](s16)
405 ; VI-NEXT: [[PTR_ADD2:%[0-9]+]]:_(p1) = G_PTR_ADD [[PTR_ADD]], [[C3]](s64)
406 ; VI-NEXT: G_STORE [[LSHR]](s32), [[PTR_ADD]](p1) :: (store (s8) into unknown-address + 2, addrspace 1)
407 ; VI-NEXT: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[LSHR2]](s16)
408 ; VI-NEXT: G_STORE [[ANYEXT1]](s32), [[PTR_ADD2]](p1) :: (store (s8) into unknown-address + 3, addrspace 1)
409 %0:_(p1) = COPY $vgpr0_vgpr1
410 %1:_(s64) = COPY $vgpr2_vgpr3
411 G_STORE %1, %0 :: (store (s32), addrspace 1, align 1)
415 name: test_truncstore_global_s128_to_s16
418 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
420 ; SI-LABEL: name: test_truncstore_global_s128_to_s16
421 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
423 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
424 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(s128) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
425 ; SI-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s128)
426 ; SI-NEXT: G_STORE [[TRUNC]](s32), [[COPY]](p1) :: (store (s16), addrspace 1)
427 ; VI-LABEL: name: test_truncstore_global_s128_to_s16
428 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
430 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
431 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(s128) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
432 ; VI-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s128)
433 ; VI-NEXT: G_STORE [[TRUNC]](s32), [[COPY]](p1) :: (store (s16), addrspace 1)
434 %0:_(p1) = COPY $vgpr0_vgpr1
435 %1:_(s128) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
436 G_STORE %1, %0 :: (store (s16), addrspace 1)
440 name: test_truncstore_global_s128_to_s8
443 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
445 ; SI-LABEL: name: test_truncstore_global_s128_to_s8
446 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
448 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
449 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(s128) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
450 ; SI-NEXT: [[BITCAST:%[0-9]+]]:_(<4 x s32>) = G_BITCAST [[COPY1]](s128)
451 ; SI-NEXT: G_STORE [[BITCAST]](<4 x s32>), [[COPY]](p1) :: (store (<4 x s32>), addrspace 1)
452 ; VI-LABEL: name: test_truncstore_global_s128_to_s8
453 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
455 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
456 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(s128) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
457 ; VI-NEXT: [[BITCAST:%[0-9]+]]:_(<4 x s32>) = G_BITCAST [[COPY1]](s128)
458 ; VI-NEXT: G_STORE [[BITCAST]](<4 x s32>), [[COPY]](p1) :: (store (<4 x s32>), addrspace 1)
459 %0:_(p1) = COPY $vgpr0_vgpr1
460 %1:_(s128) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
461 G_STORE %1, %0 :: (store (s128), addrspace 1)
465 name: test_store_global_i1
468 liveins: $vgpr0_vgpr1, $vgpr2
470 ; SI-LABEL: name: test_store_global_i1
471 ; SI: liveins: $vgpr0_vgpr1, $vgpr2
473 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
474 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
475 ; SI-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
476 ; SI-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]
477 ; SI-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[AND]], [[C]]
478 ; SI-NEXT: G_STORE [[AND1]](s32), [[COPY]](p1) :: (store (s8), addrspace 1)
479 ; VI-LABEL: name: test_store_global_i1
480 ; VI: liveins: $vgpr0_vgpr1, $vgpr2
482 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
483 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
484 ; VI-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
485 ; VI-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]
486 ; VI-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[AND]], [[C]]
487 ; VI-NEXT: G_STORE [[AND1]](s32), [[COPY]](p1) :: (store (s8), addrspace 1)
488 %0:_(p1) = COPY $vgpr0_vgpr1
489 %1:_(s32) = COPY $vgpr2
490 %2:_(s1) = G_TRUNC %1
491 G_STORE %2, %0 :: (store (s1), addrspace 1)
495 name: test_store_global_i8
498 liveins: $vgpr0_vgpr1, $vgpr2
500 ; SI-LABEL: name: test_store_global_i8
501 ; SI: liveins: $vgpr0_vgpr1, $vgpr2
503 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
504 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
505 ; SI-NEXT: G_STORE [[COPY1]](s32), [[COPY]](p1) :: (store (s8), addrspace 1)
506 ; VI-LABEL: name: test_store_global_i8
507 ; VI: liveins: $vgpr0_vgpr1, $vgpr2
509 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
510 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
511 ; VI-NEXT: G_STORE [[COPY1]](s32), [[COPY]](p1) :: (store (s8), addrspace 1)
512 %0:_(p1) = COPY $vgpr0_vgpr1
513 %1:_(s32) = COPY $vgpr2
514 %2:_(s8) = G_TRUNC %1
515 G_STORE %2, %0 :: (store (s8), addrspace 1)
519 name: test_store_global_i16
522 liveins: $vgpr0_vgpr1, $vgpr2
524 ; SI-LABEL: name: test_store_global_i16
525 ; SI: liveins: $vgpr0_vgpr1, $vgpr2
527 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
528 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
529 ; SI-NEXT: G_STORE [[COPY1]](s32), [[COPY]](p1) :: (store (s16), addrspace 1)
530 ; VI-LABEL: name: test_store_global_i16
531 ; VI: liveins: $vgpr0_vgpr1, $vgpr2
533 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
534 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
535 ; VI-NEXT: G_STORE [[COPY1]](s32), [[COPY]](p1) :: (store (s16), addrspace 1)
536 %0:_(p1) = COPY $vgpr0_vgpr1
537 %1:_(s32) = COPY $vgpr2
538 %2:_(s16) = G_TRUNC %1
539 G_STORE %2, %0 :: (store (s16), addrspace 1)
543 name: test_store_global_96
546 liveins: $vgpr0_vgpr1_vgpr2, $vgpr3_vgpr4
548 ; SI-LABEL: name: test_store_global_96
549 ; SI: liveins: $vgpr0_vgpr1_vgpr2, $vgpr3_vgpr4
551 ; SI-NEXT: [[COPY:%[0-9]+]]:_(s96) = COPY $vgpr0_vgpr1_vgpr2
552 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(p1) = COPY $vgpr3_vgpr4
553 ; SI-NEXT: [[BITCAST:%[0-9]+]]:_(<3 x s32>) = G_BITCAST [[COPY]](s96)
554 ; SI-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[BITCAST]](<3 x s32>)
555 ; SI-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[UV]](s32), [[UV1]](s32)
556 ; SI-NEXT: G_STORE [[BUILD_VECTOR]](<2 x s32>), [[COPY1]](p1) :: (store (<2 x s32>), align 16, addrspace 1)
557 ; SI-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
558 ; SI-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY1]], [[C]](s64)
559 ; SI-NEXT: G_STORE [[UV2]](s32), [[PTR_ADD]](p1) :: (store (s32) into unknown-address + 8, align 8, addrspace 1)
560 ; VI-LABEL: name: test_store_global_96
561 ; VI: liveins: $vgpr0_vgpr1_vgpr2, $vgpr3_vgpr4
563 ; VI-NEXT: [[COPY:%[0-9]+]]:_(s96) = COPY $vgpr0_vgpr1_vgpr2
564 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(p1) = COPY $vgpr3_vgpr4
565 ; VI-NEXT: [[BITCAST:%[0-9]+]]:_(<3 x s32>) = G_BITCAST [[COPY]](s96)
566 ; VI-NEXT: G_STORE [[BITCAST]](<3 x s32>), [[COPY1]](p1) :: (store (<3 x s32>), align 16, addrspace 1)
567 %0:_(s96) = COPY $vgpr0_vgpr1_vgpr2
568 %1:_(p1) = COPY $vgpr3_vgpr4
570 G_STORE %0, %1 :: (store (s96), addrspace 1, align 16)
574 name: test_store_global_i128
577 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
579 ; SI-LABEL: name: test_store_global_i128
580 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
582 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
583 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(s128) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
584 ; SI-NEXT: [[BITCAST:%[0-9]+]]:_(<4 x s32>) = G_BITCAST [[COPY1]](s128)
585 ; SI-NEXT: G_STORE [[BITCAST]](<4 x s32>), [[COPY]](p1) :: (store (<4 x s32>), addrspace 1)
586 ; VI-LABEL: name: test_store_global_i128
587 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
589 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
590 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(s128) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
591 ; VI-NEXT: [[BITCAST:%[0-9]+]]:_(<4 x s32>) = G_BITCAST [[COPY1]](s128)
592 ; VI-NEXT: G_STORE [[BITCAST]](<4 x s32>), [[COPY]](p1) :: (store (<4 x s32>), addrspace 1)
593 %0:_(p1) = COPY $vgpr0_vgpr1
594 %1:_(s128) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
595 G_STORE %1, %0 :: (store (s128), addrspace 1)
599 name: test_store_global_v2s64
602 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
604 ; SI-LABEL: name: test_store_global_v2s64
605 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
607 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
608 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
609 ; SI-NEXT: G_STORE [[COPY1]](<2 x s64>), [[COPY]](p1) :: (store (<2 x s64>), addrspace 1)
610 ; VI-LABEL: name: test_store_global_v2s64
611 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
613 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
614 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
615 ; VI-NEXT: G_STORE [[COPY1]](<2 x s64>), [[COPY]](p1) :: (store (<2 x s64>), addrspace 1)
616 %0:_(p1) = COPY $vgpr0_vgpr1
617 %1:_(<2 x s64>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
618 G_STORE %1, %0 :: (store (<2 x s64>), addrspace 1)
623 name: test_store_global_v2s8_align1
626 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
628 ; SI-LABEL: name: test_store_global_v2s8_align1
629 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
631 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
632 ; SI-NEXT: [[DEF:%[0-9]+]]:_(<2 x s32>) = G_IMPLICIT_DEF
633 ; SI-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<2 x s32>)
634 ; SI-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
635 ; SI-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
636 ; SI-NEXT: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
637 ; SI-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
638 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
639 ; SI-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
640 ; SI-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[UV1]], [[C2]]
641 ; SI-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[COPY1]](s32)
642 ; SI-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32)
643 ; SI-NEXT: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[TRUNC1]]
644 ; SI-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
645 ; SI-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
646 ; SI-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[ANYEXT]], [[C3]]
647 ; SI-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND2]], [[C1]](s32)
648 ; SI-NEXT: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
649 ; SI-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C4]](s64)
650 ; SI-NEXT: G_STORE [[ANYEXT]](s32), [[COPY]](p1) :: (store (s8), addrspace 1)
651 ; SI-NEXT: G_STORE [[LSHR]](s32), [[PTR_ADD]](p1) :: (store (s8) into unknown-address + 1, addrspace 1)
652 ; VI-LABEL: name: test_store_global_v2s8_align1
653 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
655 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
656 ; VI-NEXT: [[DEF:%[0-9]+]]:_(<2 x s32>) = G_IMPLICIT_DEF
657 ; VI-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<2 x s32>)
658 ; VI-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
659 ; VI-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
660 ; VI-NEXT: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
661 ; VI-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[UV1]](s32)
662 ; VI-NEXT: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[C]]
663 ; VI-NEXT: [[C1:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
664 ; VI-NEXT: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[AND1]], [[C1]](s16)
665 ; VI-NEXT: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[SHL]]
666 ; VI-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
667 ; VI-NEXT: [[LSHR:%[0-9]+]]:_(s16) = G_LSHR [[OR]], [[C1]](s16)
668 ; VI-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
669 ; VI-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C2]](s64)
670 ; VI-NEXT: G_STORE [[ANYEXT]](s32), [[COPY]](p1) :: (store (s8), addrspace 1)
671 ; VI-NEXT: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[LSHR]](s16)
672 ; VI-NEXT: G_STORE [[ANYEXT1]](s32), [[PTR_ADD]](p1) :: (store (s8) into unknown-address + 1, addrspace 1)
673 %0:_(p1) = COPY $vgpr0_vgpr1
674 %1:_(<2 x s8>) = G_IMPLICIT_DEF
675 G_STORE %1, %0 :: (store (<2 x s8>), addrspace 1, align 1)
680 name: test_store_global_v2s8_align2
683 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
685 ; SI-LABEL: name: test_store_global_v2s8_align2
686 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
688 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
689 ; SI-NEXT: [[DEF:%[0-9]+]]:_(<2 x s32>) = G_IMPLICIT_DEF
690 ; SI-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<2 x s32>)
691 ; SI-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
692 ; SI-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
693 ; SI-NEXT: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
694 ; SI-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
695 ; SI-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
696 ; SI-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[UV1]], [[C2]]
697 ; SI-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32)
698 ; SI-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32)
699 ; SI-NEXT: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[TRUNC1]]
700 ; SI-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
701 ; SI-NEXT: G_STORE [[ANYEXT]](s32), [[COPY]](p1) :: (store (s16), addrspace 1)
702 ; VI-LABEL: name: test_store_global_v2s8_align2
703 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
705 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
706 ; VI-NEXT: [[DEF:%[0-9]+]]:_(<2 x s32>) = G_IMPLICIT_DEF
707 ; VI-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<2 x s32>)
708 ; VI-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
709 ; VI-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
710 ; VI-NEXT: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
711 ; VI-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[UV1]](s32)
712 ; VI-NEXT: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[C]]
713 ; VI-NEXT: [[C1:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
714 ; VI-NEXT: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[AND1]], [[C1]](s16)
715 ; VI-NEXT: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[SHL]]
716 ; VI-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
717 ; VI-NEXT: G_STORE [[ANYEXT]](s32), [[COPY]](p1) :: (store (s16), addrspace 1)
718 %0:_(p1) = COPY $vgpr0_vgpr1
719 %1:_(<2 x s8>) = G_IMPLICIT_DEF
720 G_STORE %1, %0 :: (store (<2 x s8>), addrspace 1, align 2)
725 name: test_store_global_v2s8_align4
728 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
730 ; SI-LABEL: name: test_store_global_v2s8_align4
731 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
733 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
734 ; SI-NEXT: [[DEF:%[0-9]+]]:_(<2 x s32>) = G_IMPLICIT_DEF
735 ; SI-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<2 x s32>)
736 ; SI-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
737 ; SI-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
738 ; SI-NEXT: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
739 ; SI-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
740 ; SI-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
741 ; SI-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[UV1]], [[C2]]
742 ; SI-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32)
743 ; SI-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32)
744 ; SI-NEXT: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[TRUNC1]]
745 ; SI-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
746 ; SI-NEXT: G_STORE [[ANYEXT]](s32), [[COPY]](p1) :: (store (s16), align 4, addrspace 1)
747 ; VI-LABEL: name: test_store_global_v2s8_align4
748 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
750 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
751 ; VI-NEXT: [[DEF:%[0-9]+]]:_(<2 x s32>) = G_IMPLICIT_DEF
752 ; VI-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<2 x s32>)
753 ; VI-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
754 ; VI-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
755 ; VI-NEXT: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
756 ; VI-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[UV1]](s32)
757 ; VI-NEXT: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[C]]
758 ; VI-NEXT: [[C1:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
759 ; VI-NEXT: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[AND1]], [[C1]](s16)
760 ; VI-NEXT: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[SHL]]
761 ; VI-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
762 ; VI-NEXT: G_STORE [[ANYEXT]](s32), [[COPY]](p1) :: (store (s16), align 4, addrspace 1)
763 %0:_(p1) = COPY $vgpr0_vgpr1
764 %1:_(<2 x s8>) = G_IMPLICIT_DEF
765 G_STORE %1, %0 :: (store (<2 x s8>), addrspace 1, align 4)
770 name: test_store_global_v3s8_align1
773 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
775 ; SI-LABEL: name: test_store_global_v3s8_align1
776 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
778 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
779 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
780 ; SI-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<3 x s32>)
781 ; SI-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
782 ; SI-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
783 ; SI-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
784 ; SI-NEXT: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
785 ; SI-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
786 ; SI-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
787 ; SI-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
788 ; SI-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[UV1]], [[C2]]
789 ; SI-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[COPY2]](s32)
790 ; SI-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32)
791 ; SI-NEXT: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[TRUNC1]]
792 ; SI-NEXT: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[UV2]](s32)
793 ; SI-NEXT: [[AND2:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[C]]
794 ; SI-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
795 ; SI-NEXT: [[AND3:%[0-9]+]]:_(s32) = G_AND [[DEF]], [[C2]]
796 ; SI-NEXT: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[COPY3]](s32)
797 ; SI-NEXT: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[SHL1]](s32)
798 ; SI-NEXT: [[OR1:%[0-9]+]]:_(s16) = G_OR [[AND2]], [[TRUNC3]]
799 ; SI-NEXT: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[OR]](s16)
800 ; SI-NEXT: [[ZEXT1:%[0-9]+]]:_(s32) = G_ZEXT [[OR1]](s16)
801 ; SI-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
802 ; SI-NEXT: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[ZEXT1]], [[C3]](s32)
803 ; SI-NEXT: [[OR2:%[0-9]+]]:_(s32) = G_OR [[ZEXT]], [[SHL2]]
804 ; SI-NEXT: [[COPY4:%[0-9]+]]:_(s32) = COPY [[OR2]](s32)
805 ; SI-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY4]], [[C3]](s32)
806 ; SI-NEXT: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
807 ; SI-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C4]](s64)
808 ; SI-NEXT: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
809 ; SI-NEXT: [[AND4:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C5]]
810 ; SI-NEXT: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[AND4]], [[C1]](s32)
811 ; SI-NEXT: [[C6:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
812 ; SI-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C6]](s64)
813 ; SI-NEXT: G_STORE [[COPY4]](s32), [[COPY]](p1) :: (store (s8), addrspace 1)
814 ; SI-NEXT: G_STORE [[LSHR1]](s32), [[PTR_ADD1]](p1) :: (store (s8) into unknown-address + 1, addrspace 1)
815 ; SI-NEXT: G_STORE [[LSHR]](s32), [[PTR_ADD]](p1) :: (store (s8) into unknown-address + 2, addrspace 1)
816 ; VI-LABEL: name: test_store_global_v3s8_align1
817 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
819 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
820 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
821 ; VI-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<3 x s32>)
822 ; VI-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
823 ; VI-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
824 ; VI-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
825 ; VI-NEXT: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
826 ; VI-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[UV1]](s32)
827 ; VI-NEXT: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[C]]
828 ; VI-NEXT: [[C1:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
829 ; VI-NEXT: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[AND1]], [[C1]](s16)
830 ; VI-NEXT: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[SHL]]
831 ; VI-NEXT: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[UV2]](s32)
832 ; VI-NEXT: [[AND2:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[C]]
833 ; VI-NEXT: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[DEF]](s32)
834 ; VI-NEXT: [[AND3:%[0-9]+]]:_(s16) = G_AND [[TRUNC3]], [[C]]
835 ; VI-NEXT: [[SHL1:%[0-9]+]]:_(s16) = G_SHL [[AND3]], [[C1]](s16)
836 ; VI-NEXT: [[OR1:%[0-9]+]]:_(s16) = G_OR [[AND2]], [[SHL1]]
837 ; VI-NEXT: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[OR]](s16)
838 ; VI-NEXT: [[ZEXT1:%[0-9]+]]:_(s32) = G_ZEXT [[OR1]](s16)
839 ; VI-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
840 ; VI-NEXT: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[ZEXT1]], [[C2]](s32)
841 ; VI-NEXT: [[OR2:%[0-9]+]]:_(s32) = G_OR [[ZEXT]], [[SHL2]]
842 ; VI-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[OR2]](s32)
843 ; VI-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY2]], [[C2]](s32)
844 ; VI-NEXT: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
845 ; VI-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C3]](s64)
846 ; VI-NEXT: [[LSHR1:%[0-9]+]]:_(s16) = G_LSHR [[OR]], [[C1]](s16)
847 ; VI-NEXT: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
848 ; VI-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C4]](s64)
849 ; VI-NEXT: G_STORE [[COPY2]](s32), [[COPY]](p1) :: (store (s8), addrspace 1)
850 ; VI-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[LSHR1]](s16)
851 ; VI-NEXT: G_STORE [[ANYEXT]](s32), [[PTR_ADD1]](p1) :: (store (s8) into unknown-address + 1, addrspace 1)
852 ; VI-NEXT: G_STORE [[LSHR]](s32), [[PTR_ADD]](p1) :: (store (s8) into unknown-address + 2, addrspace 1)
853 %0:_(p1) = COPY $vgpr0_vgpr1
854 %1:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
855 %2:_(<3 x s8>) = G_TRUNC %1
856 G_STORE %2, %0 :: (store (<3 x s8>), addrspace 1, align 1)
861 name: test_store_global_v3s8_align2
864 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
866 ; SI-LABEL: name: test_store_global_v3s8_align2
867 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
869 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
870 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
871 ; SI-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<3 x s32>)
872 ; SI-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
873 ; SI-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
874 ; SI-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
875 ; SI-NEXT: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
876 ; SI-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
877 ; SI-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
878 ; SI-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
879 ; SI-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[UV1]], [[C2]]
880 ; SI-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[COPY2]](s32)
881 ; SI-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32)
882 ; SI-NEXT: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[TRUNC1]]
883 ; SI-NEXT: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[UV2]](s32)
884 ; SI-NEXT: [[AND2:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[C]]
885 ; SI-NEXT: [[AND3:%[0-9]+]]:_(s32) = G_AND [[DEF]], [[C2]]
886 ; SI-NEXT: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C1]](s32)
887 ; SI-NEXT: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[SHL1]](s32)
888 ; SI-NEXT: [[OR1:%[0-9]+]]:_(s16) = G_OR [[AND2]], [[TRUNC3]]
889 ; SI-NEXT: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[OR]](s16)
890 ; SI-NEXT: [[ZEXT1:%[0-9]+]]:_(s32) = G_ZEXT [[OR1]](s16)
891 ; SI-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
892 ; SI-NEXT: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[ZEXT1]], [[C3]](s32)
893 ; SI-NEXT: [[OR2:%[0-9]+]]:_(s32) = G_OR [[ZEXT]], [[SHL2]]
894 ; SI-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY [[OR2]](s32)
895 ; SI-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY3]], [[C3]](s32)
896 ; SI-NEXT: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
897 ; SI-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C4]](s64)
898 ; SI-NEXT: G_STORE [[COPY3]](s32), [[COPY]](p1) :: (store (s16), addrspace 1)
899 ; SI-NEXT: G_STORE [[LSHR]](s32), [[PTR_ADD]](p1) :: (store (s8) into unknown-address + 2, align 2, addrspace 1)
900 ; VI-LABEL: name: test_store_global_v3s8_align2
901 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
903 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
904 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
905 ; VI-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<3 x s32>)
906 ; VI-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
907 ; VI-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
908 ; VI-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
909 ; VI-NEXT: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
910 ; VI-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[UV1]](s32)
911 ; VI-NEXT: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[C]]
912 ; VI-NEXT: [[C1:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
913 ; VI-NEXT: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[AND1]], [[C1]](s16)
914 ; VI-NEXT: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[SHL]]
915 ; VI-NEXT: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[UV2]](s32)
916 ; VI-NEXT: [[AND2:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[C]]
917 ; VI-NEXT: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[DEF]](s32)
918 ; VI-NEXT: [[AND3:%[0-9]+]]:_(s16) = G_AND [[TRUNC3]], [[C]]
919 ; VI-NEXT: [[SHL1:%[0-9]+]]:_(s16) = G_SHL [[AND3]], [[C1]](s16)
920 ; VI-NEXT: [[OR1:%[0-9]+]]:_(s16) = G_OR [[AND2]], [[SHL1]]
921 ; VI-NEXT: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[OR]](s16)
922 ; VI-NEXT: [[ZEXT1:%[0-9]+]]:_(s32) = G_ZEXT [[OR1]](s16)
923 ; VI-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
924 ; VI-NEXT: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[ZEXT1]], [[C2]](s32)
925 ; VI-NEXT: [[OR2:%[0-9]+]]:_(s32) = G_OR [[ZEXT]], [[SHL2]]
926 ; VI-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[OR2]](s32)
927 ; VI-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY2]], [[C2]](s32)
928 ; VI-NEXT: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
929 ; VI-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C3]](s64)
930 ; VI-NEXT: G_STORE [[COPY2]](s32), [[COPY]](p1) :: (store (s16), addrspace 1)
931 ; VI-NEXT: G_STORE [[LSHR]](s32), [[PTR_ADD]](p1) :: (store (s8) into unknown-address + 2, align 2, addrspace 1)
932 %0:_(p1) = COPY $vgpr0_vgpr1
933 %1:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
934 %2:_(<3 x s8>) = G_TRUNC %1
935 G_STORE %2, %0 :: (store (<3 x s8>), addrspace 1, align 2)
940 name: test_store_global_v3s8_align4
943 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
945 ; SI-LABEL: name: test_store_global_v3s8_align4
946 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
948 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
949 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
950 ; SI-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<3 x s32>)
951 ; SI-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
952 ; SI-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
953 ; SI-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
954 ; SI-NEXT: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
955 ; SI-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
956 ; SI-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
957 ; SI-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
958 ; SI-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[UV1]], [[C2]]
959 ; SI-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[COPY2]](s32)
960 ; SI-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32)
961 ; SI-NEXT: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[TRUNC1]]
962 ; SI-NEXT: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[UV2]](s32)
963 ; SI-NEXT: [[AND2:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[C]]
964 ; SI-NEXT: [[AND3:%[0-9]+]]:_(s32) = G_AND [[DEF]], [[C2]]
965 ; SI-NEXT: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C1]](s32)
966 ; SI-NEXT: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[SHL1]](s32)
967 ; SI-NEXT: [[OR1:%[0-9]+]]:_(s16) = G_OR [[AND2]], [[TRUNC3]]
968 ; SI-NEXT: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[OR]](s16)
969 ; SI-NEXT: [[ZEXT1:%[0-9]+]]:_(s32) = G_ZEXT [[OR1]](s16)
970 ; SI-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
971 ; SI-NEXT: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[ZEXT1]], [[C3]](s32)
972 ; SI-NEXT: [[OR2:%[0-9]+]]:_(s32) = G_OR [[ZEXT]], [[SHL2]]
973 ; SI-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY [[OR2]](s32)
974 ; SI-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY3]], [[C3]](s32)
975 ; SI-NEXT: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
976 ; SI-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C4]](s64)
977 ; SI-NEXT: G_STORE [[COPY3]](s32), [[COPY]](p1) :: (store (s16), align 4, addrspace 1)
978 ; SI-NEXT: G_STORE [[LSHR]](s32), [[PTR_ADD]](p1) :: (store (s8) into unknown-address + 2, align 2, addrspace 1)
979 ; VI-LABEL: name: test_store_global_v3s8_align4
980 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
982 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
983 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
984 ; VI-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<3 x s32>)
985 ; VI-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
986 ; VI-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
987 ; VI-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
988 ; VI-NEXT: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
989 ; VI-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[UV1]](s32)
990 ; VI-NEXT: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[C]]
991 ; VI-NEXT: [[C1:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
992 ; VI-NEXT: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[AND1]], [[C1]](s16)
993 ; VI-NEXT: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[SHL]]
994 ; VI-NEXT: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[UV2]](s32)
995 ; VI-NEXT: [[AND2:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[C]]
996 ; VI-NEXT: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[DEF]](s32)
997 ; VI-NEXT: [[AND3:%[0-9]+]]:_(s16) = G_AND [[TRUNC3]], [[C]]
998 ; VI-NEXT: [[SHL1:%[0-9]+]]:_(s16) = G_SHL [[AND3]], [[C1]](s16)
999 ; VI-NEXT: [[OR1:%[0-9]+]]:_(s16) = G_OR [[AND2]], [[SHL1]]
1000 ; VI-NEXT: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[OR]](s16)
1001 ; VI-NEXT: [[ZEXT1:%[0-9]+]]:_(s32) = G_ZEXT [[OR1]](s16)
1002 ; VI-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
1003 ; VI-NEXT: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[ZEXT1]], [[C2]](s32)
1004 ; VI-NEXT: [[OR2:%[0-9]+]]:_(s32) = G_OR [[ZEXT]], [[SHL2]]
1005 ; VI-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[OR2]](s32)
1006 ; VI-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY2]], [[C2]](s32)
1007 ; VI-NEXT: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
1008 ; VI-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C3]](s64)
1009 ; VI-NEXT: G_STORE [[COPY2]](s32), [[COPY]](p1) :: (store (s16), align 4, addrspace 1)
1010 ; VI-NEXT: G_STORE [[LSHR]](s32), [[PTR_ADD]](p1) :: (store (s8) into unknown-address + 2, align 2, addrspace 1)
1011 %0:_(p1) = COPY $vgpr0_vgpr1
1012 %1:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
1013 %2:_(<3 x s8>) = G_TRUNC %1
1014 G_STORE %2, %0 :: (store (<3 x s8>), addrspace 1, align 4)
1019 name: test_store_global_v4s8_align1
1022 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
1024 ; SI-LABEL: name: test_store_global_v4s8_align1
1025 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
1027 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
1028 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
1029 ; SI-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<4 x s32>)
1030 ; SI-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
1031 ; SI-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[UV]], [[C]]
1032 ; SI-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[UV1]], [[C]]
1033 ; SI-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
1034 ; SI-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32)
1035 ; SI-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]]
1036 ; SI-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[UV2]], [[C]]
1037 ; SI-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
1038 ; SI-NEXT: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND2]], [[C2]](s32)
1039 ; SI-NEXT: [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]]
1040 ; SI-NEXT: [[AND3:%[0-9]+]]:_(s32) = G_AND [[UV3]], [[C]]
1041 ; SI-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
1042 ; SI-NEXT: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C3]](s32)
1043 ; SI-NEXT: [[OR2:%[0-9]+]]:_(s32) = G_OR [[OR1]], [[SHL2]]
1044 ; SI-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[OR2]](s32)
1045 ; SI-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY2]], [[C2]](s32)
1046 ; SI-NEXT: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
1047 ; SI-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C4]](s64)
1048 ; SI-NEXT: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
1049 ; SI-NEXT: [[AND4:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C5]]
1050 ; SI-NEXT: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[AND4]], [[C1]](s32)
1051 ; SI-NEXT: [[C6:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
1052 ; SI-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C6]](s64)
1053 ; SI-NEXT: G_STORE [[COPY2]](s32), [[COPY]](p1) :: (store (s8), addrspace 1)
1054 ; SI-NEXT: G_STORE [[LSHR1]](s32), [[PTR_ADD1]](p1) :: (store (s8) into unknown-address + 1, addrspace 1)
1055 ; SI-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
1056 ; SI-NEXT: [[AND5:%[0-9]+]]:_(s32) = G_AND [[LSHR]], [[C5]]
1057 ; SI-NEXT: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[AND5]], [[COPY3]](s32)
1058 ; SI-NEXT: [[PTR_ADD2:%[0-9]+]]:_(p1) = G_PTR_ADD [[PTR_ADD]], [[C6]](s64)
1059 ; SI-NEXT: G_STORE [[LSHR]](s32), [[PTR_ADD]](p1) :: (store (s8) into unknown-address + 2, addrspace 1)
1060 ; SI-NEXT: G_STORE [[LSHR2]](s32), [[PTR_ADD2]](p1) :: (store (s8) into unknown-address + 3, addrspace 1)
1061 ; VI-LABEL: name: test_store_global_v4s8_align1
1062 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
1064 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
1065 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
1066 ; VI-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<4 x s32>)
1067 ; VI-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
1068 ; VI-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[UV]], [[C]]
1069 ; VI-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[UV1]], [[C]]
1070 ; VI-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
1071 ; VI-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32)
1072 ; VI-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]]
1073 ; VI-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[UV2]], [[C]]
1074 ; VI-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
1075 ; VI-NEXT: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND2]], [[C2]](s32)
1076 ; VI-NEXT: [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]]
1077 ; VI-NEXT: [[AND3:%[0-9]+]]:_(s32) = G_AND [[UV3]], [[C]]
1078 ; VI-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
1079 ; VI-NEXT: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C3]](s32)
1080 ; VI-NEXT: [[OR2:%[0-9]+]]:_(s32) = G_OR [[OR1]], [[SHL2]]
1081 ; VI-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[OR2]](s32)
1082 ; VI-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY2]], [[C2]](s32)
1083 ; VI-NEXT: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
1084 ; VI-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C4]](s64)
1085 ; VI-NEXT: [[C5:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
1086 ; VI-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32)
1087 ; VI-NEXT: [[AND4:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C5]]
1088 ; VI-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[UV1]](s32)
1089 ; VI-NEXT: [[AND5:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[C5]]
1090 ; VI-NEXT: [[C6:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
1091 ; VI-NEXT: [[SHL3:%[0-9]+]]:_(s16) = G_SHL [[AND5]], [[C6]](s16)
1092 ; VI-NEXT: [[OR3:%[0-9]+]]:_(s16) = G_OR [[AND4]], [[SHL3]]
1093 ; VI-NEXT: [[LSHR1:%[0-9]+]]:_(s16) = G_LSHR [[OR3]], [[C6]](s16)
1094 ; VI-NEXT: [[C7:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
1095 ; VI-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C7]](s64)
1096 ; VI-NEXT: G_STORE [[COPY2]](s32), [[COPY]](p1) :: (store (s8), addrspace 1)
1097 ; VI-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[LSHR1]](s16)
1098 ; VI-NEXT: G_STORE [[ANYEXT]](s32), [[PTR_ADD1]](p1) :: (store (s8) into unknown-address + 1, addrspace 1)
1099 ; VI-NEXT: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32)
1100 ; VI-NEXT: [[LSHR2:%[0-9]+]]:_(s16) = G_LSHR [[TRUNC2]], [[C6]](s16)
1101 ; VI-NEXT: [[PTR_ADD2:%[0-9]+]]:_(p1) = G_PTR_ADD [[PTR_ADD]], [[C7]](s64)
1102 ; VI-NEXT: G_STORE [[LSHR]](s32), [[PTR_ADD]](p1) :: (store (s8) into unknown-address + 2, addrspace 1)
1103 ; VI-NEXT: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[LSHR2]](s16)
1104 ; VI-NEXT: G_STORE [[ANYEXT1]](s32), [[PTR_ADD2]](p1) :: (store (s8) into unknown-address + 3, addrspace 1)
1105 %0:_(p1) = COPY $vgpr0_vgpr1
1106 %1:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
1107 %2:_(<4 x s8>) = G_TRUNC %1
1108 G_STORE %2, %0 :: (store (<4 x s8>), addrspace 1, align 1)
1113 name: test_store_global_v4s8_align2
1116 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
1118 ; SI-LABEL: name: test_store_global_v4s8_align2
1119 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
1121 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
1122 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
1123 ; SI-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<4 x s32>)
1124 ; SI-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
1125 ; SI-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[UV]], [[C]]
1126 ; SI-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[UV1]], [[C]]
1127 ; SI-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
1128 ; SI-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32)
1129 ; SI-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]]
1130 ; SI-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[UV2]], [[C]]
1131 ; SI-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
1132 ; SI-NEXT: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND2]], [[C2]](s32)
1133 ; SI-NEXT: [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]]
1134 ; SI-NEXT: [[AND3:%[0-9]+]]:_(s32) = G_AND [[UV3]], [[C]]
1135 ; SI-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
1136 ; SI-NEXT: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C3]](s32)
1137 ; SI-NEXT: [[OR2:%[0-9]+]]:_(s32) = G_OR [[OR1]], [[SHL2]]
1138 ; SI-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[OR2]](s32)
1139 ; SI-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY2]], [[C2]](s32)
1140 ; SI-NEXT: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
1141 ; SI-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C4]](s64)
1142 ; SI-NEXT: G_STORE [[COPY2]](s32), [[COPY]](p1) :: (store (s16), addrspace 1)
1143 ; SI-NEXT: G_STORE [[LSHR]](s32), [[PTR_ADD]](p1) :: (store (s16) into unknown-address + 2, addrspace 1)
1144 ; VI-LABEL: name: test_store_global_v4s8_align2
1145 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
1147 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
1148 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
1149 ; VI-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<4 x s32>)
1150 ; VI-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
1151 ; VI-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[UV]], [[C]]
1152 ; VI-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[UV1]], [[C]]
1153 ; VI-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
1154 ; VI-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32)
1155 ; VI-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]]
1156 ; VI-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[UV2]], [[C]]
1157 ; VI-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
1158 ; VI-NEXT: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND2]], [[C2]](s32)
1159 ; VI-NEXT: [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]]
1160 ; VI-NEXT: [[AND3:%[0-9]+]]:_(s32) = G_AND [[UV3]], [[C]]
1161 ; VI-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
1162 ; VI-NEXT: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C3]](s32)
1163 ; VI-NEXT: [[OR2:%[0-9]+]]:_(s32) = G_OR [[OR1]], [[SHL2]]
1164 ; VI-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[OR2]](s32)
1165 ; VI-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY2]], [[C2]](s32)
1166 ; VI-NEXT: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
1167 ; VI-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C4]](s64)
1168 ; VI-NEXT: G_STORE [[COPY2]](s32), [[COPY]](p1) :: (store (s16), addrspace 1)
1169 ; VI-NEXT: G_STORE [[LSHR]](s32), [[PTR_ADD]](p1) :: (store (s16) into unknown-address + 2, addrspace 1)
1170 %0:_(p1) = COPY $vgpr0_vgpr1
1171 %1:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
1172 %2:_(<4 x s8>) = G_TRUNC %1
1173 G_STORE %2, %0 :: (store (<4 x s8>), addrspace 1, align 2)
1178 name: test_store_global_v4s8_align4
1181 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
1183 ; SI-LABEL: name: test_store_global_v4s8_align4
1184 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
1186 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
1187 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
1188 ; SI-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<4 x s32>)
1189 ; SI-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
1190 ; SI-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[UV]], [[C]]
1191 ; SI-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[UV1]], [[C]]
1192 ; SI-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
1193 ; SI-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32)
1194 ; SI-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]]
1195 ; SI-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[UV2]], [[C]]
1196 ; SI-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
1197 ; SI-NEXT: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND2]], [[C2]](s32)
1198 ; SI-NEXT: [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]]
1199 ; SI-NEXT: [[AND3:%[0-9]+]]:_(s32) = G_AND [[UV3]], [[C]]
1200 ; SI-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
1201 ; SI-NEXT: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C3]](s32)
1202 ; SI-NEXT: [[OR2:%[0-9]+]]:_(s32) = G_OR [[OR1]], [[SHL2]]
1203 ; SI-NEXT: G_STORE [[OR2]](s32), [[COPY]](p1) :: (store (s32), addrspace 1)
1204 ; VI-LABEL: name: test_store_global_v4s8_align4
1205 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
1207 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
1208 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
1209 ; VI-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<4 x s32>)
1210 ; VI-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
1211 ; VI-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[UV]], [[C]]
1212 ; VI-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[UV1]], [[C]]
1213 ; VI-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
1214 ; VI-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32)
1215 ; VI-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]]
1216 ; VI-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[UV2]], [[C]]
1217 ; VI-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
1218 ; VI-NEXT: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND2]], [[C2]](s32)
1219 ; VI-NEXT: [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]]
1220 ; VI-NEXT: [[AND3:%[0-9]+]]:_(s32) = G_AND [[UV3]], [[C]]
1221 ; VI-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
1222 ; VI-NEXT: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C3]](s32)
1223 ; VI-NEXT: [[OR2:%[0-9]+]]:_(s32) = G_OR [[OR1]], [[SHL2]]
1224 ; VI-NEXT: G_STORE [[OR2]](s32), [[COPY]](p1) :: (store (s32), addrspace 1)
1225 %0:_(p1) = COPY $vgpr0_vgpr1
1226 %1:_(<4 x s32>) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
1227 %2:_(<4 x s8>) = G_TRUNC %1
1228 G_STORE %2, %0 :: (store (<4 x s8>), addrspace 1, align 4)
1233 name: test_truncstore_global_v2s8_to_1_align1
1236 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
1238 ; SI-LABEL: name: test_truncstore_global_v2s8_to_1_align1
1239 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
1241 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
1242 ; SI-NEXT: [[DEF:%[0-9]+]]:_(<2 x s8>) = G_IMPLICIT_DEF
1243 ; SI-NEXT: G_STORE [[DEF]](<2 x s8>), [[COPY]](p1) :: (store (<2 x s4>), addrspace 1)
1244 ; VI-LABEL: name: test_truncstore_global_v2s8_to_1_align1
1245 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
1247 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
1248 ; VI-NEXT: [[DEF:%[0-9]+]]:_(<2 x s8>) = G_IMPLICIT_DEF
1249 ; VI-NEXT: G_STORE [[DEF]](<2 x s8>), [[COPY]](p1) :: (store (<2 x s4>), addrspace 1)
1250 %0:_(p1) = COPY $vgpr0_vgpr1
1251 %1:_(<2 x s8>) = G_IMPLICIT_DEF
1252 G_STORE %1, %0 :: (store (<2 x s4>), addrspace 1, align 1)
1257 name: test_truncstore_global_v3s8_to_1_align1
1260 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
1262 ; SI-LABEL: name: test_truncstore_global_v3s8_to_1_align1
1263 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
1265 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
1266 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
1267 ; SI-NEXT: [[TRUNC:%[0-9]+]]:_(<3 x s8>) = G_TRUNC [[COPY1]](<3 x s32>)
1268 ; SI-NEXT: G_STORE [[TRUNC]](<3 x s8>), [[COPY]](p1) :: (store (<3 x s2>), addrspace 1)
1269 ; VI-LABEL: name: test_truncstore_global_v3s8_to_1_align1
1270 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
1272 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
1273 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
1274 ; VI-NEXT: [[TRUNC:%[0-9]+]]:_(<3 x s8>) = G_TRUNC [[COPY1]](<3 x s32>)
1275 ; VI-NEXT: G_STORE [[TRUNC]](<3 x s8>), [[COPY]](p1) :: (store (<3 x s2>), addrspace 1)
1276 %0:_(p1) = COPY $vgpr0_vgpr1
1277 %1:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
1278 %2:_(<3 x s8>) = G_TRUNC %1
1279 G_STORE %2, %0 :: (store (<3 x s2>), addrspace 1, align 1)
1284 name: test_truncstore_global_v3s8_to_2_align2
1287 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
1289 ; SI-LABEL: name: test_truncstore_global_v3s8_to_2_align2
1290 ; SI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
1292 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
1293 ; SI-NEXT: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
1294 ; SI-NEXT: [[TRUNC:%[0-9]+]]:_(<3 x s8>) = G_TRUNC [[COPY1]](<3 x s32>)
1295 ; SI-NEXT: G_STORE [[TRUNC]](<3 x s8>), [[COPY]](p1) :: (store (<3 x s4>), addrspace 1)
1296 ; VI-LABEL: name: test_truncstore_global_v3s8_to_2_align2
1297 ; VI: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
1299 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
1300 ; VI-NEXT: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
1301 ; VI-NEXT: [[TRUNC:%[0-9]+]]:_(<3 x s8>) = G_TRUNC [[COPY1]](<3 x s32>)
1302 ; VI-NEXT: G_STORE [[TRUNC]](<3 x s8>), [[COPY]](p1) :: (store (<3 x s4>), addrspace 1)
1303 %0:_(p1) = COPY $vgpr0_vgpr1
1304 %1:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
1305 %2:_(<3 x s8>) = G_TRUNC %1
1306 G_STORE %2, %0 :: (store (<3 x s4>), addrspace 1, align 2)