1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=fiji -run-pass=legalizer -global-isel-abort=2 -pass-remarks-missed='gisel*' -o - 2> %t %s | FileCheck -check-prefix=GFX8 %s
3 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=tahiti -run-pass=legalizer -global-isel-abort=2 -o - %s | FileCheck -check-prefix=GFX6 %s
4 # RUN: FileCheck -check-prefixes=ERR %s < %t
6 # FIXME: Run with and without unaligned access turned on
9 # ERR: remark: <unknown>:0:0: unable to legalize instruction: %1:_(<2 x s16>) = G_ZEXTLOAD %0:_(p1) :: (load (<2 x s8>), addrspace 1) (in function: test_zextload_global_v2i16_from_2)
10 # ERR-NEXT: remark: <unknown>:0:0: unable to legalize instruction: %1:_(<2 x s32>) = G_ZEXTLOAD %0:_(p1) :: (load (<2 x s8>), addrspace 1) (in function: test_zextload_global_v2i32_from_2)
11 # ERR-NEXT: remark: <unknown>:0:0: unable to legalize instruction: %1:_(<2 x s32>) = G_ZEXTLOAD %0:_(p1) :: (load (<2 x s16>), addrspace 1) (in function: test_zextload_global_v2i32_from_4)
12 # ERR-NEXT: remark: <unknown>:0:0: unable to legalize instruction: %1:_(<2 x s64>) = G_ZEXTLOAD %0:_(p1) :: (load (<2 x s16>), addrspace 1) (in function: test_zextload_global_v2i64_from_4)
13 # ERR-NEXT: remark: <unknown>:0:0: unable to legalize instruction: %1:_(<2 x s64>) = G_ZEXTLOAD %0:_(p1) :: (load (<2 x s32>), addrspace 1) (in function: test_zextload_global_v2i64_from_8)
14 # ERR-NEXT: remark: <unknown>:0:0: unable to legalize instruction: %1:_(s128) = G_ZEXTLOAD %0:_(p1) :: (load (s64), addrspace 1) (in function: test_zextload_global_s128_8)
18 name: test_zextload_global_i32_i1
23 ; GFX8-LABEL: name: test_zextload_global_i32_i1
24 ; GFX8: liveins: $vgpr0_vgpr1
26 ; GFX8-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
27 ; GFX8-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p1) :: (load (s8), addrspace 1)
28 ; GFX8-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s32) = G_ASSERT_ZEXT [[LOAD]], 1
29 ; GFX8-NEXT: $vgpr0 = COPY [[ASSERT_ZEXT]](s32)
30 ; GFX6-LABEL: name: test_zextload_global_i32_i1
31 ; GFX6: liveins: $vgpr0_vgpr1
33 ; GFX6-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
34 ; GFX6-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p1) :: (load (s8), addrspace 1)
35 ; GFX6-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s32) = G_ASSERT_ZEXT [[LOAD]], 1
36 ; GFX6-NEXT: $vgpr0 = COPY [[ASSERT_ZEXT]](s32)
37 %0:_(p1) = COPY $vgpr0_vgpr1
38 %1:_(s32) = G_ZEXTLOAD %0 :: (load (s1), addrspace 1)
43 name: test_zextload_global_i32_i7
48 ; GFX8-LABEL: name: test_zextload_global_i32_i7
49 ; GFX8: liveins: $vgpr0_vgpr1
51 ; GFX8-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
52 ; GFX8-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p1) :: (load (s8), addrspace 1)
53 ; GFX8-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s32) = G_ASSERT_ZEXT [[LOAD]], 7
54 ; GFX8-NEXT: $vgpr0 = COPY [[ASSERT_ZEXT]](s32)
55 ; GFX6-LABEL: name: test_zextload_global_i32_i7
56 ; GFX6: liveins: $vgpr0_vgpr1
58 ; GFX6-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
59 ; GFX6-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p1) :: (load (s8), addrspace 1)
60 ; GFX6-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s32) = G_ASSERT_ZEXT [[LOAD]], 7
61 ; GFX6-NEXT: $vgpr0 = COPY [[ASSERT_ZEXT]](s32)
62 %0:_(p1) = COPY $vgpr0_vgpr1
63 %1:_(s32) = G_ZEXTLOAD %0 :: (load (s7), addrspace 1)
68 name: test_zextload_global_i32_i24
73 ; GFX8-LABEL: name: test_zextload_global_i32_i24
74 ; GFX8: liveins: $vgpr0_vgpr1
76 ; GFX8-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
77 ; GFX8-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p1) :: (load (s16), align 4, addrspace 1)
78 ; GFX8-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
79 ; GFX8-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C]](s64)
80 ; GFX8-NEXT: [[ZEXTLOAD1:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[PTR_ADD]](p1) :: (load (s8) from unknown-address + 2, align 2, addrspace 1)
81 ; GFX8-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
82 ; GFX8-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[ZEXTLOAD1]], [[C1]](s32)
83 ; GFX8-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[SHL]], [[ZEXTLOAD]]
84 ; GFX8-NEXT: $vgpr0 = COPY [[OR]](s32)
85 ; GFX6-LABEL: name: test_zextload_global_i32_i24
86 ; GFX6: liveins: $vgpr0_vgpr1
88 ; GFX6-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
89 ; GFX6-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p1) :: (load (s16), align 4, addrspace 1)
90 ; GFX6-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
91 ; GFX6-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C]](s64)
92 ; GFX6-NEXT: [[ZEXTLOAD1:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[PTR_ADD]](p1) :: (load (s8) from unknown-address + 2, align 2, addrspace 1)
93 ; GFX6-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
94 ; GFX6-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[ZEXTLOAD1]], [[C1]](s32)
95 ; GFX6-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[SHL]], [[ZEXTLOAD]]
96 ; GFX6-NEXT: $vgpr0 = COPY [[OR]](s32)
97 %0:_(p1) = COPY $vgpr0_vgpr1
98 %1:_(s32) = G_ZEXTLOAD %0 :: (load (s24), addrspace 1)
103 name: test_zextload_global_i32_i30
106 liveins: $vgpr0_vgpr1
108 ; GFX8-LABEL: name: test_zextload_global_i32_i30
109 ; GFX8: liveins: $vgpr0_vgpr1
111 ; GFX8-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
112 ; GFX8-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p1) :: (load (s32), addrspace 1)
113 ; GFX8-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s32) = G_ASSERT_ZEXT [[LOAD]], 30
114 ; GFX8-NEXT: $vgpr0 = COPY [[ASSERT_ZEXT]](s32)
115 ; GFX6-LABEL: name: test_zextload_global_i32_i30
116 ; GFX6: liveins: $vgpr0_vgpr1
118 ; GFX6-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
119 ; GFX6-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p1) :: (load (s32), addrspace 1)
120 ; GFX6-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s32) = G_ASSERT_ZEXT [[LOAD]], 30
121 ; GFX6-NEXT: $vgpr0 = COPY [[ASSERT_ZEXT]](s32)
122 %0:_(p1) = COPY $vgpr0_vgpr1
123 %1:_(s32) = G_ZEXTLOAD %0 :: (load (s30), addrspace 1)
128 name: test_zextload_global_i32_i31
131 liveins: $vgpr0_vgpr1
133 ; GFX8-LABEL: name: test_zextload_global_i32_i31
134 ; GFX8: liveins: $vgpr0_vgpr1
136 ; GFX8-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
137 ; GFX8-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p1) :: (load (s32), addrspace 1)
138 ; GFX8-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s32) = G_ASSERT_ZEXT [[LOAD]], 31
139 ; GFX8-NEXT: $vgpr0 = COPY [[ASSERT_ZEXT]](s32)
140 ; GFX6-LABEL: name: test_zextload_global_i32_i31
141 ; GFX6: liveins: $vgpr0_vgpr1
143 ; GFX6-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
144 ; GFX6-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p1) :: (load (s32), addrspace 1)
145 ; GFX6-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s32) = G_ASSERT_ZEXT [[LOAD]], 31
146 ; GFX6-NEXT: $vgpr0 = COPY [[ASSERT_ZEXT]](s32)
147 %0:_(p1) = COPY $vgpr0_vgpr1
148 %1:_(s32) = G_ZEXTLOAD %0 :: (load (s31), addrspace 1)
153 name: test_zextload_global_i32_i8
156 liveins: $vgpr0_vgpr1
158 ; GFX8-LABEL: name: test_zextload_global_i32_i8
159 ; GFX8: liveins: $vgpr0_vgpr1
161 ; GFX8-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
162 ; GFX8-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p1) :: (load (s8), addrspace 1)
163 ; GFX8-NEXT: $vgpr0 = COPY [[ZEXTLOAD]](s32)
164 ; GFX6-LABEL: name: test_zextload_global_i32_i8
165 ; GFX6: liveins: $vgpr0_vgpr1
167 ; GFX6-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
168 ; GFX6-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p1) :: (load (s8), addrspace 1)
169 ; GFX6-NEXT: $vgpr0 = COPY [[ZEXTLOAD]](s32)
170 %0:_(p1) = COPY $vgpr0_vgpr1
171 %1:_(s32) = G_ZEXTLOAD %0 :: (load (s8), addrspace 1)
175 name: test_zextload_global_i32_i16
178 liveins: $vgpr0_vgpr1
180 ; GFX8-LABEL: name: test_zextload_global_i32_i16
181 ; GFX8: liveins: $vgpr0_vgpr1
183 ; GFX8-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
184 ; GFX8-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p1) :: (load (s16), addrspace 1)
185 ; GFX8-NEXT: $vgpr0 = COPY [[ZEXTLOAD]](s32)
186 ; GFX6-LABEL: name: test_zextload_global_i32_i16
187 ; GFX6: liveins: $vgpr0_vgpr1
189 ; GFX6-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
190 ; GFX6-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p1) :: (load (s16), addrspace 1)
191 ; GFX6-NEXT: $vgpr0 = COPY [[ZEXTLOAD]](s32)
192 %0:_(p1) = COPY $vgpr0_vgpr1
193 %1:_(s32) = G_ZEXTLOAD %0 :: (load (s16), addrspace 1)
197 name: test_zextload_global_i31_i8
200 liveins: $vgpr0_vgpr1
202 ; GFX8-LABEL: name: test_zextload_global_i31_i8
203 ; GFX8: liveins: $vgpr0_vgpr1
205 ; GFX8-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
206 ; GFX8-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p1) :: (load (s8), addrspace 1)
207 ; GFX8-NEXT: $vgpr0 = COPY [[ZEXTLOAD]](s32)
208 ; GFX6-LABEL: name: test_zextload_global_i31_i8
209 ; GFX6: liveins: $vgpr0_vgpr1
211 ; GFX6-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
212 ; GFX6-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p1) :: (load (s8), addrspace 1)
213 ; GFX6-NEXT: $vgpr0 = COPY [[ZEXTLOAD]](s32)
214 %0:_(p1) = COPY $vgpr0_vgpr1
215 %1:_(s31) = G_ZEXTLOAD %0 :: (load (s8), addrspace 1)
216 %2:_(s32) = G_ANYEXT %1
220 name: test_zextload_global_i64_i8
223 liveins: $vgpr0_vgpr1
225 ; GFX8-LABEL: name: test_zextload_global_i64_i8
226 ; GFX8: liveins: $vgpr0_vgpr1
228 ; GFX8-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
229 ; GFX8-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p1) :: (load (s8), addrspace 1)
230 ; GFX8-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[ZEXTLOAD]](s32)
231 ; GFX8-NEXT: $vgpr0_vgpr1 = COPY [[ZEXT]](s64)
232 ; GFX6-LABEL: name: test_zextload_global_i64_i8
233 ; GFX6: liveins: $vgpr0_vgpr1
235 ; GFX6-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
236 ; GFX6-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p1) :: (load (s8), addrspace 1)
237 ; GFX6-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[ZEXTLOAD]](s32)
238 ; GFX6-NEXT: $vgpr0_vgpr1 = COPY [[ZEXT]](s64)
239 %0:_(p1) = COPY $vgpr0_vgpr1
240 %1:_(s64) = G_ZEXTLOAD %0 :: (load (s8), addrspace 1)
241 $vgpr0_vgpr1 = COPY %1
244 name: test_zextload_global_i64_i16
247 liveins: $vgpr0_vgpr1
249 ; GFX8-LABEL: name: test_zextload_global_i64_i16
250 ; GFX8: liveins: $vgpr0_vgpr1
252 ; GFX8-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
253 ; GFX8-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p1) :: (load (s16), addrspace 1)
254 ; GFX8-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[ZEXTLOAD]](s32)
255 ; GFX8-NEXT: $vgpr0_vgpr1 = COPY [[ZEXT]](s64)
256 ; GFX6-LABEL: name: test_zextload_global_i64_i16
257 ; GFX6: liveins: $vgpr0_vgpr1
259 ; GFX6-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
260 ; GFX6-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p1) :: (load (s16), addrspace 1)
261 ; GFX6-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[ZEXTLOAD]](s32)
262 ; GFX6-NEXT: $vgpr0_vgpr1 = COPY [[ZEXT]](s64)
263 %0:_(p1) = COPY $vgpr0_vgpr1
264 %1:_(s64) = G_ZEXTLOAD %0 :: (load (s16), addrspace 1)
265 $vgpr0_vgpr1 = COPY %1
268 name: test_zextload_global_i64_i32
271 liveins: $vgpr0_vgpr1
273 ; GFX8-LABEL: name: test_zextload_global_i64_i32
274 ; GFX8: liveins: $vgpr0_vgpr1
276 ; GFX8-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
277 ; GFX8-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p1) :: (load (s32), addrspace 1)
278 ; GFX8-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[LOAD]](s32)
279 ; GFX8-NEXT: $vgpr0_vgpr1 = COPY [[ZEXT]](s64)
280 ; GFX6-LABEL: name: test_zextload_global_i64_i32
281 ; GFX6: liveins: $vgpr0_vgpr1
283 ; GFX6-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
284 ; GFX6-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p1) :: (load (s32), addrspace 1)
285 ; GFX6-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[LOAD]](s32)
286 ; GFX6-NEXT: $vgpr0_vgpr1 = COPY [[ZEXT]](s64)
287 %0:_(p1) = COPY $vgpr0_vgpr1
288 %1:_(s64) = G_ZEXTLOAD %0 :: (load (s32), addrspace 1)
289 $vgpr0_vgpr1 = COPY %1
293 name: test_zextload_global_s32_from_2_align1
296 liveins: $vgpr0_vgpr1
298 ; GFX8-LABEL: name: test_zextload_global_s32_from_2_align1
299 ; GFX8: liveins: $vgpr0_vgpr1
301 ; GFX8-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
302 ; GFX8-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p1) :: (load (s16), align 1, addrspace 1)
303 ; GFX8-NEXT: $vgpr0 = COPY [[ZEXTLOAD]](s32)
304 ; GFX6-LABEL: name: test_zextload_global_s32_from_2_align1
305 ; GFX6: liveins: $vgpr0_vgpr1
307 ; GFX6-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
308 ; GFX6-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p1) :: (load (s8), addrspace 1)
309 ; GFX6-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
310 ; GFX6-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C]](s64)
311 ; GFX6-NEXT: [[ZEXTLOAD1:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[PTR_ADD]](p1) :: (load (s8) from unknown-address + 1, addrspace 1)
312 ; GFX6-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
313 ; GFX6-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[ZEXTLOAD1]], [[C1]](s32)
314 ; GFX6-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[SHL]], [[ZEXTLOAD]]
315 ; GFX6-NEXT: $vgpr0 = COPY [[OR]](s32)
316 %0:_(p1) = COPY $vgpr0_vgpr1
317 %1:_(s32) = G_ZEXTLOAD %0 :: (load (s16), align 1, addrspace 1)
322 name: test_zextload_global_s64_from_2_align1
325 liveins: $vgpr0_vgpr1
327 ; GFX8-LABEL: name: test_zextload_global_s64_from_2_align1
328 ; GFX8: liveins: $vgpr0_vgpr1
330 ; GFX8-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
331 ; GFX8-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p1) :: (load (s16), align 1, addrspace 1)
332 ; GFX8-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[ZEXTLOAD]](s32)
333 ; GFX8-NEXT: $vgpr0_vgpr1 = COPY [[ZEXT]](s64)
334 ; GFX6-LABEL: name: test_zextload_global_s64_from_2_align1
335 ; GFX6: liveins: $vgpr0_vgpr1
337 ; GFX6-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
338 ; GFX6-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p1) :: (load (s8), addrspace 1)
339 ; GFX6-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
340 ; GFX6-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[C]](s64)
341 ; GFX6-NEXT: [[ZEXTLOAD1:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[PTR_ADD]](p1) :: (load (s8) from unknown-address + 1, addrspace 1)
342 ; GFX6-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
343 ; GFX6-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[ZEXTLOAD1]], [[C1]](s32)
344 ; GFX6-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[SHL]], [[ZEXTLOAD]]
345 ; GFX6-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[OR]](s32)
346 ; GFX6-NEXT: $vgpr0_vgpr1 = COPY [[ZEXT]](s64)
347 %0:_(p1) = COPY $vgpr0_vgpr1
348 %1:_(s64) = G_ZEXTLOAD %0 :: (load (s16), align 1, addrspace 1)
349 $vgpr0_vgpr1 = COPY %1
353 name: test_zextload_global_v2i16_from_2
356 liveins: $vgpr0_vgpr1
358 ; GFX8-LABEL: name: test_zextload_global_v2i16_from_2
359 ; GFX8: liveins: $vgpr0_vgpr1
361 ; GFX8-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
362 ; GFX8-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(<2 x s16>) = G_ZEXTLOAD [[COPY]](p1) :: (load (<2 x s8>), addrspace 1)
363 ; GFX8-NEXT: $vgpr0 = COPY [[ZEXTLOAD]](<2 x s16>)
364 ; GFX6-LABEL: name: test_zextload_global_v2i16_from_2
365 ; GFX6: liveins: $vgpr0_vgpr1
367 ; GFX6-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
368 ; GFX6-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(<2 x s16>) = G_ZEXTLOAD [[COPY]](p1) :: (load (<2 x s8>), addrspace 1)
369 ; GFX6-NEXT: $vgpr0 = COPY [[ZEXTLOAD]](<2 x s16>)
370 %0:_(p1) = COPY $vgpr0_vgpr1
371 %1:_(<2 x s16>) = G_ZEXTLOAD %0 :: (load (<2 x s8>), addrspace 1)
376 name: test_zextload_global_v2i32_from_2
379 liveins: $vgpr0_vgpr1
381 ; GFX8-LABEL: name: test_zextload_global_v2i32_from_2
382 ; GFX8: liveins: $vgpr0_vgpr1
384 ; GFX8-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
385 ; GFX8-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(<2 x s32>) = G_ZEXTLOAD [[COPY]](p1) :: (load (<2 x s8>), addrspace 1)
386 ; GFX8-NEXT: $vgpr0_vgpr1 = COPY [[ZEXTLOAD]](<2 x s32>)
387 ; GFX6-LABEL: name: test_zextload_global_v2i32_from_2
388 ; GFX6: liveins: $vgpr0_vgpr1
390 ; GFX6-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
391 ; GFX6-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(<2 x s32>) = G_ZEXTLOAD [[COPY]](p1) :: (load (<2 x s8>), addrspace 1)
392 ; GFX6-NEXT: $vgpr0_vgpr1 = COPY [[ZEXTLOAD]](<2 x s32>)
393 %0:_(p1) = COPY $vgpr0_vgpr1
394 %1:_(<2 x s32>) = G_ZEXTLOAD %0 :: (load (<2 x s8>), addrspace 1)
395 $vgpr0_vgpr1 = COPY %1
399 name: test_zextload_global_v2i32_from_4
402 liveins: $vgpr0_vgpr1
404 ; GFX8-LABEL: name: test_zextload_global_v2i32_from_4
405 ; GFX8: liveins: $vgpr0_vgpr1
407 ; GFX8-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
408 ; GFX8-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(<2 x s32>) = G_ZEXTLOAD [[COPY]](p1) :: (load (<2 x s16>), addrspace 1)
409 ; GFX8-NEXT: $vgpr0_vgpr1 = COPY [[ZEXTLOAD]](<2 x s32>)
410 ; GFX6-LABEL: name: test_zextload_global_v2i32_from_4
411 ; GFX6: liveins: $vgpr0_vgpr1
413 ; GFX6-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
414 ; GFX6-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(<2 x s32>) = G_ZEXTLOAD [[COPY]](p1) :: (load (<2 x s16>), addrspace 1)
415 ; GFX6-NEXT: $vgpr0_vgpr1 = COPY [[ZEXTLOAD]](<2 x s32>)
416 %0:_(p1) = COPY $vgpr0_vgpr1
417 %1:_(<2 x s32>) = G_ZEXTLOAD %0 :: (load (<2 x s16>), addrspace 1)
418 $vgpr0_vgpr1 = COPY %1
422 name: test_zextload_global_v2i64_from_4
425 liveins: $vgpr0_vgpr1
427 ; GFX8-LABEL: name: test_zextload_global_v2i64_from_4
428 ; GFX8: liveins: $vgpr0_vgpr1
430 ; GFX8-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
431 ; GFX8-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(<2 x s64>) = G_ZEXTLOAD [[COPY]](p1) :: (load (<2 x s16>), addrspace 1)
432 ; GFX8-NEXT: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[ZEXTLOAD]](<2 x s64>)
433 ; GFX6-LABEL: name: test_zextload_global_v2i64_from_4
434 ; GFX6: liveins: $vgpr0_vgpr1
436 ; GFX6-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
437 ; GFX6-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(<2 x s64>) = G_ZEXTLOAD [[COPY]](p1) :: (load (<2 x s16>), addrspace 1)
438 ; GFX6-NEXT: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[ZEXTLOAD]](<2 x s64>)
439 %0:_(p1) = COPY $vgpr0_vgpr1
440 %1:_(<2 x s64>) = G_ZEXTLOAD %0 :: (load (<2 x s16>), addrspace 1)
441 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1
445 name: test_zextload_global_v2i64_from_8
448 liveins: $vgpr0_vgpr1
450 ; GFX8-LABEL: name: test_zextload_global_v2i64_from_8
451 ; GFX8: liveins: $vgpr0_vgpr1
453 ; GFX8-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
454 ; GFX8-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(<2 x s64>) = G_ZEXTLOAD [[COPY]](p1) :: (load (<2 x s32>), addrspace 1)
455 ; GFX8-NEXT: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[ZEXTLOAD]](<2 x s64>)
456 ; GFX6-LABEL: name: test_zextload_global_v2i64_from_8
457 ; GFX6: liveins: $vgpr0_vgpr1
459 ; GFX6-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
460 ; GFX6-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(<2 x s64>) = G_ZEXTLOAD [[COPY]](p1) :: (load (<2 x s32>), addrspace 1)
461 ; GFX6-NEXT: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[ZEXTLOAD]](<2 x s64>)
462 %0:_(p1) = COPY $vgpr0_vgpr1
463 %1:_(<2 x s64>) = G_ZEXTLOAD %0 :: (load (<2 x s32>), addrspace 1)
464 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1
468 name: test_zextload_global_s128_8
471 liveins: $vgpr0_vgpr1
473 ; GFX8-LABEL: name: test_zextload_global_s128_8
474 ; GFX8: liveins: $vgpr0_vgpr1
476 ; GFX8-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
477 ; GFX8-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(s128) = G_ZEXTLOAD [[COPY]](p1) :: (load (s64), addrspace 1)
478 ; GFX8-NEXT: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[ZEXTLOAD]](s128)
479 ; GFX6-LABEL: name: test_zextload_global_s128_8
480 ; GFX6: liveins: $vgpr0_vgpr1
482 ; GFX6-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
483 ; GFX6-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(s128) = G_ZEXTLOAD [[COPY]](p1) :: (load (s64), addrspace 1)
484 ; GFX6-NEXT: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[ZEXTLOAD]](s128)
485 %0:_(p1) = COPY $vgpr0_vgpr1
486 %1:_(s128) = G_ZEXTLOAD %0 :: (load (s64), addrspace 1)
487 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1