1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=fiji -O0 -run-pass=legalizer -global-isel-abort=0 -o - %s | FileCheck -check-prefix=VI %s
3 # RUN: llc -march=amdgcn -mcpu=gfx900 -O0 -run-pass=legalizer -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX9 %s
4 # RUN: llc -march=amdgcn -mcpu=tahiti -O0 -run-pass=legalizer -global-isel-abort=0 -o - %s | FileCheck -check-prefix=SI %s
7 name: test_addrspacecast_p0_to_p1
10 queuePtr: { reg: '$sgpr4_sgpr5' }
16 ; VI-LABEL: name: test_addrspacecast_p0_to_p1
17 ; VI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
18 ; VI: [[BITCAST:%[0-9]+]]:_(p1) = G_BITCAST [[COPY]](p0)
19 ; VI: $vgpr0_vgpr1 = COPY [[BITCAST]](p1)
20 ; GFX9-LABEL: name: test_addrspacecast_p0_to_p1
21 ; GFX9: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
22 ; GFX9: [[BITCAST:%[0-9]+]]:_(p1) = G_BITCAST [[COPY]](p0)
23 ; GFX9: $vgpr0_vgpr1 = COPY [[BITCAST]](p1)
24 ; SI-LABEL: name: test_addrspacecast_p0_to_p1
25 ; SI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
26 ; SI: [[BITCAST:%[0-9]+]]:_(p1) = G_BITCAST [[COPY]](p0)
27 ; SI: $vgpr0_vgpr1 = COPY [[BITCAST]](p1)
28 %0:_(p0) = COPY $vgpr0_vgpr1
29 %1:_(p1) = G_ADDRSPACE_CAST %0
30 $vgpr0_vgpr1 = COPY %1
34 name: test_addrspacecast_p1_to_p0
37 queuePtr: { reg: '$sgpr4_sgpr5' }
43 ; VI-LABEL: name: test_addrspacecast_p1_to_p0
44 ; VI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
45 ; VI: [[BITCAST:%[0-9]+]]:_(p0) = G_BITCAST [[COPY]](p1)
46 ; VI: $vgpr0_vgpr1 = COPY [[BITCAST]](p0)
47 ; GFX9-LABEL: name: test_addrspacecast_p1_to_p0
48 ; GFX9: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
49 ; GFX9: [[BITCAST:%[0-9]+]]:_(p0) = G_BITCAST [[COPY]](p1)
50 ; GFX9: $vgpr0_vgpr1 = COPY [[BITCAST]](p0)
51 ; SI-LABEL: name: test_addrspacecast_p1_to_p0
52 ; SI: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
53 ; SI: [[BITCAST:%[0-9]+]]:_(p0) = G_BITCAST [[COPY]](p1)
54 ; SI: $vgpr0_vgpr1 = COPY [[BITCAST]](p0)
55 %0:_(p1) = COPY $vgpr0_vgpr1
56 %1:_(p0) = G_ADDRSPACE_CAST %0
57 $vgpr0_vgpr1 = COPY %1
61 name: test_addrspacecast_p0_to_p4
64 queuePtr: { reg: '$sgpr4_sgpr5' }
69 ; VI-LABEL: name: test_addrspacecast_p0_to_p4
70 ; VI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
71 ; VI: [[BITCAST:%[0-9]+]]:_(p4) = G_BITCAST [[COPY]](p0)
72 ; VI: $vgpr0_vgpr1 = COPY [[BITCAST]](p4)
73 ; GFX9-LABEL: name: test_addrspacecast_p0_to_p4
74 ; GFX9: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
75 ; GFX9: [[BITCAST:%[0-9]+]]:_(p4) = G_BITCAST [[COPY]](p0)
76 ; GFX9: $vgpr0_vgpr1 = COPY [[BITCAST]](p4)
77 ; SI-LABEL: name: test_addrspacecast_p0_to_p4
78 ; SI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
79 ; SI: [[BITCAST:%[0-9]+]]:_(p4) = G_BITCAST [[COPY]](p0)
80 ; SI: $vgpr0_vgpr1 = COPY [[BITCAST]](p4)
81 %0:_(p0) = COPY $vgpr0_vgpr1
82 %1:_(p4) = G_ADDRSPACE_CAST %0
83 $vgpr0_vgpr1 = COPY %1
87 name: test_addrspacecast_p4_to_p0
90 queuePtr: { reg: '$sgpr4_sgpr5' }
95 ; VI-LABEL: name: test_addrspacecast_p4_to_p0
96 ; VI: [[COPY:%[0-9]+]]:_(p4) = COPY $vgpr0_vgpr1
97 ; VI: [[BITCAST:%[0-9]+]]:_(p0) = G_BITCAST [[COPY]](p4)
98 ; VI: $vgpr0_vgpr1 = COPY [[BITCAST]](p0)
99 ; GFX9-LABEL: name: test_addrspacecast_p4_to_p0
100 ; GFX9: [[COPY:%[0-9]+]]:_(p4) = COPY $vgpr0_vgpr1
101 ; GFX9: [[BITCAST:%[0-9]+]]:_(p0) = G_BITCAST [[COPY]](p4)
102 ; GFX9: $vgpr0_vgpr1 = COPY [[BITCAST]](p0)
103 ; SI-LABEL: name: test_addrspacecast_p4_to_p0
104 ; SI: [[COPY:%[0-9]+]]:_(p4) = COPY $vgpr0_vgpr1
105 ; SI: [[BITCAST:%[0-9]+]]:_(p0) = G_BITCAST [[COPY]](p4)
106 ; SI: $vgpr0_vgpr1 = COPY [[BITCAST]](p0)
107 %0:_(p4) = COPY $vgpr0_vgpr1
108 %1:_(p0) = G_ADDRSPACE_CAST %0
109 $vgpr0_vgpr1 = COPY %1
113 name: test_addrspacecast_p0_to_p999
116 queuePtr: { reg: '$sgpr4_sgpr5' }
119 liveins: $vgpr0_vgpr1
121 ; VI-LABEL: name: test_addrspacecast_p0_to_p999
122 ; VI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
123 ; VI: [[BITCAST:%[0-9]+]]:_(p999) = G_BITCAST [[COPY]](p0)
124 ; VI: $vgpr0_vgpr1 = COPY [[BITCAST]](p999)
125 ; GFX9-LABEL: name: test_addrspacecast_p0_to_p999
126 ; GFX9: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
127 ; GFX9: [[BITCAST:%[0-9]+]]:_(p999) = G_BITCAST [[COPY]](p0)
128 ; GFX9: $vgpr0_vgpr1 = COPY [[BITCAST]](p999)
129 ; SI-LABEL: name: test_addrspacecast_p0_to_p999
130 ; SI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
131 ; SI: [[BITCAST:%[0-9]+]]:_(p999) = G_BITCAST [[COPY]](p0)
132 ; SI: $vgpr0_vgpr1 = COPY [[BITCAST]](p999)
133 %0:_(p0) = COPY $vgpr0_vgpr1
134 %1:_(p999) = G_ADDRSPACE_CAST %0
135 $vgpr0_vgpr1 = COPY %1
139 name: test_addrspacecast_p999_to_p0
142 queuePtr: { reg: '$sgpr4_sgpr5' }
145 liveins: $vgpr0_vgpr1
147 ; VI-LABEL: name: test_addrspacecast_p999_to_p0
148 ; VI: [[COPY:%[0-9]+]]:_(p999) = COPY $vgpr0_vgpr1
149 ; VI: [[BITCAST:%[0-9]+]]:_(p0) = G_BITCAST [[COPY]](p999)
150 ; VI: $vgpr0_vgpr1 = COPY [[BITCAST]](p0)
151 ; GFX9-LABEL: name: test_addrspacecast_p999_to_p0
152 ; GFX9: [[COPY:%[0-9]+]]:_(p999) = COPY $vgpr0_vgpr1
153 ; GFX9: [[BITCAST:%[0-9]+]]:_(p0) = G_BITCAST [[COPY]](p999)
154 ; GFX9: $vgpr0_vgpr1 = COPY [[BITCAST]](p0)
155 ; SI-LABEL: name: test_addrspacecast_p999_to_p0
156 ; SI: [[COPY:%[0-9]+]]:_(p999) = COPY $vgpr0_vgpr1
157 ; SI: [[BITCAST:%[0-9]+]]:_(p0) = G_BITCAST [[COPY]](p999)
158 ; SI: $vgpr0_vgpr1 = COPY [[BITCAST]](p0)
159 %0:_(p999) = COPY $vgpr0_vgpr1
160 %1:_(p0) = G_ADDRSPACE_CAST %0
161 $vgpr0_vgpr1 = COPY %1
165 name: test_addrspacecast_p5_to_p0
168 queuePtr: { reg: '$sgpr4_sgpr5' }
173 ; VI-LABEL: name: test_addrspacecast_p5_to_p0
174 ; VI: [[COPY:%[0-9]+]]:_(p4) = COPY $sgpr4_sgpr5
175 ; VI: [[COPY1:%[0-9]+]]:_(p5) = COPY $vgpr0
176 ; VI: [[C:%[0-9]+]]:_(p5) = G_CONSTANT i32 0
177 ; VI: [[C1:%[0-9]+]]:_(p0) = G_CONSTANT i64 0
178 ; VI: [[COPY2:%[0-9]+]]:_(p4) = COPY [[COPY]](p4)
179 ; VI: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 68
180 ; VI: [[GEP:%[0-9]+]]:_(p4) = G_GEP [[COPY2]], [[C2]](s64)
181 ; VI: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[GEP]](p4) :: (dereferenceable invariant load 4 from `i8 addrspace(4)* undef` + 68, addrspace 4)
182 ; VI: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY1]](p5), [[C]]
183 ; VI: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY1]](p5)
184 ; VI: [[MV:%[0-9]+]]:_(p0) = G_MERGE_VALUES [[PTRTOINT]](s32), [[LOAD]](s32)
185 ; VI: [[SELECT:%[0-9]+]]:_(p0) = G_SELECT [[ICMP]](s1), [[MV]], [[C1]]
186 ; VI: $vgpr0_vgpr1 = COPY [[SELECT]](p0)
187 ; GFX9-LABEL: name: test_addrspacecast_p5_to_p0
188 ; GFX9: [[COPY:%[0-9]+]]:_(p5) = COPY $vgpr0
189 ; GFX9: [[C:%[0-9]+]]:_(p5) = G_CONSTANT i32 0
190 ; GFX9: [[C1:%[0-9]+]]:_(p0) = G_CONSTANT i64 0
191 ; GFX9: [[S_GETREG_B32_:%[0-9]+]]:sreg_32(s32) = S_GETREG_B32 30735
192 ; GFX9: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
193 ; GFX9: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[S_GETREG_B32_]], [[C2]](s32)
194 ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p5), [[C]]
195 ; GFX9: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY]](p5)
196 ; GFX9: [[MV:%[0-9]+]]:_(p0) = G_MERGE_VALUES [[PTRTOINT]](s32), [[SHL]](s32)
197 ; GFX9: [[SELECT:%[0-9]+]]:_(p0) = G_SELECT [[ICMP]](s1), [[MV]], [[C1]]
198 ; GFX9: $vgpr0_vgpr1 = COPY [[SELECT]](p0)
199 ; SI-LABEL: name: test_addrspacecast_p5_to_p0
200 ; SI: [[COPY:%[0-9]+]]:_(p5) = COPY $vgpr0
201 ; SI: [[ADDRSPACE_CAST:%[0-9]+]]:_(p0) = G_ADDRSPACE_CAST [[COPY]](p5)
202 ; SI: $vgpr0_vgpr1 = COPY [[ADDRSPACE_CAST]](p0)
203 %0:_(p5) = COPY $vgpr0
204 %1:_(p0) = G_ADDRSPACE_CAST %0
205 $vgpr0_vgpr1 = COPY %1
209 name: test_addrspacecast_p0_to_p5
212 queuePtr: { reg: '$sgpr4_sgpr5' }
215 liveins: $vgpr0_vgpr1
217 ; VI-LABEL: name: test_addrspacecast_p0_to_p5
218 ; VI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
219 ; VI: [[C:%[0-9]+]]:_(p5) = G_CONSTANT i32 0
220 ; VI: [[C1:%[0-9]+]]:_(p0) = G_CONSTANT i64 0
221 ; VI: [[EXTRACT:%[0-9]+]]:_(p5) = G_EXTRACT [[COPY]](p0), 0
222 ; VI: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p0), [[C1]]
223 ; VI: [[SELECT:%[0-9]+]]:_(p5) = G_SELECT [[ICMP]](s1), [[EXTRACT]], [[C]]
224 ; VI: $vgpr0 = COPY [[SELECT]](p5)
225 ; GFX9-LABEL: name: test_addrspacecast_p0_to_p5
226 ; GFX9: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
227 ; GFX9: [[C:%[0-9]+]]:_(p5) = G_CONSTANT i32 0
228 ; GFX9: [[C1:%[0-9]+]]:_(p0) = G_CONSTANT i64 0
229 ; GFX9: [[EXTRACT:%[0-9]+]]:_(p5) = G_EXTRACT [[COPY]](p0), 0
230 ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p0), [[C1]]
231 ; GFX9: [[SELECT:%[0-9]+]]:_(p5) = G_SELECT [[ICMP]](s1), [[EXTRACT]], [[C]]
232 ; GFX9: $vgpr0 = COPY [[SELECT]](p5)
233 ; SI-LABEL: name: test_addrspacecast_p0_to_p5
234 ; SI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
235 ; SI: [[C:%[0-9]+]]:_(p5) = G_CONSTANT i32 0
236 ; SI: [[C1:%[0-9]+]]:_(p0) = G_CONSTANT i64 0
237 ; SI: [[EXTRACT:%[0-9]+]]:_(p5) = G_EXTRACT [[COPY]](p0), 0
238 ; SI: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p0), [[C1]]
239 ; SI: [[SELECT:%[0-9]+]]:_(p5) = G_SELECT [[ICMP]](s1), [[EXTRACT]], [[C]]
240 ; SI: $vgpr0 = COPY [[SELECT]](p5)
241 %0:_(p0) = COPY $vgpr0_vgpr1
242 %1:_(p5) = G_ADDRSPACE_CAST %0
247 name: test_addrspacecast_p3_to_p0
250 queuePtr: { reg: '$sgpr4_sgpr5' }
256 ; VI-LABEL: name: test_addrspacecast_p3_to_p0
257 ; VI: [[COPY:%[0-9]+]]:_(p4) = COPY $sgpr4_sgpr5
258 ; VI: [[COPY1:%[0-9]+]]:_(p3) = COPY $vgpr0
259 ; VI: [[C:%[0-9]+]]:_(p3) = G_CONSTANT i32 -1
260 ; VI: [[C1:%[0-9]+]]:_(p0) = G_CONSTANT i64 0
261 ; VI: [[COPY2:%[0-9]+]]:_(p4) = COPY [[COPY]](p4)
262 ; VI: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 64
263 ; VI: [[GEP:%[0-9]+]]:_(p4) = G_GEP [[COPY2]], [[C2]](s64)
264 ; VI: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[GEP]](p4) :: (dereferenceable invariant load 4 from `i8 addrspace(4)* undef` + 64, align 64, addrspace 4)
265 ; VI: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY1]](p3), [[C]]
266 ; VI: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY1]](p3)
267 ; VI: [[MV:%[0-9]+]]:_(p0) = G_MERGE_VALUES [[PTRTOINT]](s32), [[LOAD]](s32)
268 ; VI: [[SELECT:%[0-9]+]]:_(p0) = G_SELECT [[ICMP]](s1), [[MV]], [[C1]]
269 ; VI: $vgpr0_vgpr1 = COPY [[SELECT]](p0)
270 ; GFX9-LABEL: name: test_addrspacecast_p3_to_p0
271 ; GFX9: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
272 ; GFX9: [[C:%[0-9]+]]:_(p3) = G_CONSTANT i32 -1
273 ; GFX9: [[C1:%[0-9]+]]:_(p0) = G_CONSTANT i64 0
274 ; GFX9: [[S_GETREG_B32_:%[0-9]+]]:sreg_32(s32) = S_GETREG_B32 31759
275 ; GFX9: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
276 ; GFX9: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[S_GETREG_B32_]], [[C2]](s32)
277 ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p3), [[C]]
278 ; GFX9: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY]](p3)
279 ; GFX9: [[MV:%[0-9]+]]:_(p0) = G_MERGE_VALUES [[PTRTOINT]](s32), [[SHL]](s32)
280 ; GFX9: [[SELECT:%[0-9]+]]:_(p0) = G_SELECT [[ICMP]](s1), [[MV]], [[C1]]
281 ; GFX9: $vgpr0_vgpr1 = COPY [[SELECT]](p0)
282 ; SI-LABEL: name: test_addrspacecast_p3_to_p0
283 ; SI: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
284 ; SI: [[ADDRSPACE_CAST:%[0-9]+]]:_(p0) = G_ADDRSPACE_CAST [[COPY]](p3)
285 ; SI: $vgpr0_vgpr1 = COPY [[ADDRSPACE_CAST]](p0)
286 %0:_(p3) = COPY $vgpr0
287 %1:_(p0) = G_ADDRSPACE_CAST %0
288 $vgpr0_vgpr1 = COPY %1
292 name: test_addrspacecast_p0_to_p3
295 queuePtr: { reg: '$sgpr4_sgpr5' }
298 liveins: $vgpr0_vgpr1
300 ; VI-LABEL: name: test_addrspacecast_p0_to_p3
301 ; VI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
302 ; VI: [[C:%[0-9]+]]:_(p3) = G_CONSTANT i32 -1
303 ; VI: [[C1:%[0-9]+]]:_(p0) = G_CONSTANT i64 0
304 ; VI: [[EXTRACT:%[0-9]+]]:_(p3) = G_EXTRACT [[COPY]](p0), 0
305 ; VI: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p0), [[C1]]
306 ; VI: [[SELECT:%[0-9]+]]:_(p3) = G_SELECT [[ICMP]](s1), [[EXTRACT]], [[C]]
307 ; VI: $vgpr0 = COPY [[SELECT]](p3)
308 ; GFX9-LABEL: name: test_addrspacecast_p0_to_p3
309 ; GFX9: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
310 ; GFX9: [[C:%[0-9]+]]:_(p3) = G_CONSTANT i32 -1
311 ; GFX9: [[C1:%[0-9]+]]:_(p0) = G_CONSTANT i64 0
312 ; GFX9: [[EXTRACT:%[0-9]+]]:_(p3) = G_EXTRACT [[COPY]](p0), 0
313 ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p0), [[C1]]
314 ; GFX9: [[SELECT:%[0-9]+]]:_(p3) = G_SELECT [[ICMP]](s1), [[EXTRACT]], [[C]]
315 ; GFX9: $vgpr0 = COPY [[SELECT]](p3)
316 ; SI-LABEL: name: test_addrspacecast_p0_to_p3
317 ; SI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
318 ; SI: [[C:%[0-9]+]]:_(p3) = G_CONSTANT i32 -1
319 ; SI: [[C1:%[0-9]+]]:_(p0) = G_CONSTANT i64 0
320 ; SI: [[EXTRACT:%[0-9]+]]:_(p3) = G_EXTRACT [[COPY]](p0), 0
321 ; SI: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p0), [[C1]]
322 ; SI: [[SELECT:%[0-9]+]]:_(p3) = G_SELECT [[ICMP]](s1), [[EXTRACT]], [[C]]
323 ; SI: $vgpr0 = COPY [[SELECT]](p3)
324 %0:_(p0) = COPY $vgpr0_vgpr1
325 %1:_(p3) = G_ADDRSPACE_CAST %0
330 name: test_addrspacecast_v2p0_to_v2p1
333 queuePtr: { reg: '$sgpr4_sgpr5' }
336 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
338 ; VI-LABEL: name: test_addrspacecast_v2p0_to_v2p1
339 ; VI: [[COPY:%[0-9]+]]:_(<2 x p0>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
340 ; VI: [[UV:%[0-9]+]]:_(p0), [[UV1:%[0-9]+]]:_(p0) = G_UNMERGE_VALUES [[COPY]](<2 x p0>)
341 ; VI: [[BITCAST:%[0-9]+]]:_(p1) = G_BITCAST [[UV]](p0)
342 ; VI: [[BITCAST1:%[0-9]+]]:_(p1) = G_BITCAST [[UV1]](p0)
343 ; VI: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p1>) = G_BUILD_VECTOR [[BITCAST]](p1), [[BITCAST1]](p1)
344 ; VI: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x p1>)
345 ; GFX9-LABEL: name: test_addrspacecast_v2p0_to_v2p1
346 ; GFX9: [[COPY:%[0-9]+]]:_(<2 x p0>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
347 ; GFX9: [[UV:%[0-9]+]]:_(p0), [[UV1:%[0-9]+]]:_(p0) = G_UNMERGE_VALUES [[COPY]](<2 x p0>)
348 ; GFX9: [[BITCAST:%[0-9]+]]:_(p1) = G_BITCAST [[UV]](p0)
349 ; GFX9: [[BITCAST1:%[0-9]+]]:_(p1) = G_BITCAST [[UV1]](p0)
350 ; GFX9: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p1>) = G_BUILD_VECTOR [[BITCAST]](p1), [[BITCAST1]](p1)
351 ; GFX9: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x p1>)
352 ; SI-LABEL: name: test_addrspacecast_v2p0_to_v2p1
353 ; SI: [[COPY:%[0-9]+]]:_(<2 x p0>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
354 ; SI: [[UV:%[0-9]+]]:_(p0), [[UV1:%[0-9]+]]:_(p0) = G_UNMERGE_VALUES [[COPY]](<2 x p0>)
355 ; SI: [[BITCAST:%[0-9]+]]:_(p1) = G_BITCAST [[UV]](p0)
356 ; SI: [[BITCAST1:%[0-9]+]]:_(p1) = G_BITCAST [[UV1]](p0)
357 ; SI: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p1>) = G_BUILD_VECTOR [[BITCAST]](p1), [[BITCAST1]](p1)
358 ; SI: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x p1>)
359 %0:_(<2 x p0>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
360 %1:_(<2 x p1>) = G_ADDRSPACE_CAST %0
361 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1
365 name: test_addrspacecast_v2p1_to_v2p0
368 queuePtr: { reg: '$sgpr4_sgpr5' }
371 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
373 ; VI-LABEL: name: test_addrspacecast_v2p1_to_v2p0
374 ; VI: [[COPY:%[0-9]+]]:_(<2 x p1>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
375 ; VI: [[UV:%[0-9]+]]:_(p1), [[UV1:%[0-9]+]]:_(p1) = G_UNMERGE_VALUES [[COPY]](<2 x p1>)
376 ; VI: [[BITCAST:%[0-9]+]]:_(p0) = G_BITCAST [[UV]](p1)
377 ; VI: [[BITCAST1:%[0-9]+]]:_(p0) = G_BITCAST [[UV1]](p1)
378 ; VI: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p0>) = G_BUILD_VECTOR [[BITCAST]](p0), [[BITCAST1]](p0)
379 ; VI: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x p0>)
380 ; GFX9-LABEL: name: test_addrspacecast_v2p1_to_v2p0
381 ; GFX9: [[COPY:%[0-9]+]]:_(<2 x p1>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
382 ; GFX9: [[UV:%[0-9]+]]:_(p1), [[UV1:%[0-9]+]]:_(p1) = G_UNMERGE_VALUES [[COPY]](<2 x p1>)
383 ; GFX9: [[BITCAST:%[0-9]+]]:_(p0) = G_BITCAST [[UV]](p1)
384 ; GFX9: [[BITCAST1:%[0-9]+]]:_(p0) = G_BITCAST [[UV1]](p1)
385 ; GFX9: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p0>) = G_BUILD_VECTOR [[BITCAST]](p0), [[BITCAST1]](p0)
386 ; GFX9: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x p0>)
387 ; SI-LABEL: name: test_addrspacecast_v2p1_to_v2p0
388 ; SI: [[COPY:%[0-9]+]]:_(<2 x p1>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
389 ; SI: [[UV:%[0-9]+]]:_(p1), [[UV1:%[0-9]+]]:_(p1) = G_UNMERGE_VALUES [[COPY]](<2 x p1>)
390 ; SI: [[BITCAST:%[0-9]+]]:_(p0) = G_BITCAST [[UV]](p1)
391 ; SI: [[BITCAST1:%[0-9]+]]:_(p0) = G_BITCAST [[UV1]](p1)
392 ; SI: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p0>) = G_BUILD_VECTOR [[BITCAST]](p0), [[BITCAST1]](p0)
393 ; SI: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x p0>)
394 %0:_(<2 x p1>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
395 %1:_(<2 x p0>) = G_ADDRSPACE_CAST %0
396 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1
400 name: test_addrspacecast_v2p0_to_v2p3
403 queuePtr: { reg: '$sgpr4_sgpr5' }
406 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
408 ; VI-LABEL: name: test_addrspacecast_v2p0_to_v2p3
409 ; VI: [[COPY:%[0-9]+]]:_(<2 x p0>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
410 ; VI: [[UV:%[0-9]+]]:_(p0), [[UV1:%[0-9]+]]:_(p0) = G_UNMERGE_VALUES [[COPY]](<2 x p0>)
411 ; VI: [[C:%[0-9]+]]:_(p3) = G_CONSTANT i32 -1
412 ; VI: [[C1:%[0-9]+]]:_(p0) = G_CONSTANT i64 0
413 ; VI: [[EXTRACT:%[0-9]+]]:_(p3) = G_EXTRACT [[UV]](p0), 0
414 ; VI: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](p0), [[C1]]
415 ; VI: [[SELECT:%[0-9]+]]:_(p3) = G_SELECT [[ICMP]](s1), [[EXTRACT]], [[C]]
416 ; VI: [[EXTRACT1:%[0-9]+]]:_(p3) = G_EXTRACT [[UV1]](p0), 0
417 ; VI: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](p0), [[C1]]
418 ; VI: [[SELECT1:%[0-9]+]]:_(p3) = G_SELECT [[ICMP1]](s1), [[EXTRACT1]], [[C]]
419 ; VI: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p3>) = G_BUILD_VECTOR [[SELECT]](p3), [[SELECT1]](p3)
420 ; VI: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x p3>)
421 ; GFX9-LABEL: name: test_addrspacecast_v2p0_to_v2p3
422 ; GFX9: [[COPY:%[0-9]+]]:_(<2 x p0>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
423 ; GFX9: [[UV:%[0-9]+]]:_(p0), [[UV1:%[0-9]+]]:_(p0) = G_UNMERGE_VALUES [[COPY]](<2 x p0>)
424 ; GFX9: [[C:%[0-9]+]]:_(p3) = G_CONSTANT i32 -1
425 ; GFX9: [[C1:%[0-9]+]]:_(p0) = G_CONSTANT i64 0
426 ; GFX9: [[EXTRACT:%[0-9]+]]:_(p3) = G_EXTRACT [[UV]](p0), 0
427 ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](p0), [[C1]]
428 ; GFX9: [[SELECT:%[0-9]+]]:_(p3) = G_SELECT [[ICMP]](s1), [[EXTRACT]], [[C]]
429 ; GFX9: [[EXTRACT1:%[0-9]+]]:_(p3) = G_EXTRACT [[UV1]](p0), 0
430 ; GFX9: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](p0), [[C1]]
431 ; GFX9: [[SELECT1:%[0-9]+]]:_(p3) = G_SELECT [[ICMP1]](s1), [[EXTRACT1]], [[C]]
432 ; GFX9: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p3>) = G_BUILD_VECTOR [[SELECT]](p3), [[SELECT1]](p3)
433 ; GFX9: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x p3>)
434 ; SI-LABEL: name: test_addrspacecast_v2p0_to_v2p3
435 ; SI: [[COPY:%[0-9]+]]:_(<2 x p0>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
436 ; SI: [[UV:%[0-9]+]]:_(p0), [[UV1:%[0-9]+]]:_(p0) = G_UNMERGE_VALUES [[COPY]](<2 x p0>)
437 ; SI: [[C:%[0-9]+]]:_(p3) = G_CONSTANT i32 -1
438 ; SI: [[C1:%[0-9]+]]:_(p0) = G_CONSTANT i64 0
439 ; SI: [[EXTRACT:%[0-9]+]]:_(p3) = G_EXTRACT [[UV]](p0), 0
440 ; SI: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](p0), [[C1]]
441 ; SI: [[SELECT:%[0-9]+]]:_(p3) = G_SELECT [[ICMP]](s1), [[EXTRACT]], [[C]]
442 ; SI: [[EXTRACT1:%[0-9]+]]:_(p3) = G_EXTRACT [[UV1]](p0), 0
443 ; SI: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](p0), [[C1]]
444 ; SI: [[SELECT1:%[0-9]+]]:_(p3) = G_SELECT [[ICMP1]](s1), [[EXTRACT1]], [[C]]
445 ; SI: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p3>) = G_BUILD_VECTOR [[SELECT]](p3), [[SELECT1]](p3)
446 ; SI: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x p3>)
447 %0:_(<2 x p0>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
448 %1:_(<2 x p3>) = G_ADDRSPACE_CAST %0
449 $vgpr0_vgpr1 = COPY %1
453 name: test_addrspacecast_v2p3_to_v2p0
456 queuePtr: { reg: '$sgpr4_sgpr5' }
459 liveins: $vgpr0_vgpr1
461 ; VI-LABEL: name: test_addrspacecast_v2p3_to_v2p0
462 ; VI: [[COPY:%[0-9]+]]:_(p4) = COPY $sgpr4_sgpr5
463 ; VI: [[COPY1:%[0-9]+]]:_(<2 x p3>) = COPY $vgpr0_vgpr1
464 ; VI: [[UV:%[0-9]+]]:_(p3), [[UV1:%[0-9]+]]:_(p3) = G_UNMERGE_VALUES [[COPY1]](<2 x p3>)
465 ; VI: [[C:%[0-9]+]]:_(p3) = G_CONSTANT i32 -1
466 ; VI: [[C1:%[0-9]+]]:_(p0) = G_CONSTANT i64 0
467 ; VI: [[COPY2:%[0-9]+]]:_(p4) = COPY [[COPY]](p4)
468 ; VI: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 64
469 ; VI: [[GEP:%[0-9]+]]:_(p4) = G_GEP [[COPY2]], [[C2]](s64)
470 ; VI: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[GEP]](p4) :: (dereferenceable invariant load 4 from `i8 addrspace(4)* undef` + 64, align 64, addrspace 4)
471 ; VI: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](p3), [[C]]
472 ; VI: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[UV]](p3)
473 ; VI: [[MV:%[0-9]+]]:_(p0) = G_MERGE_VALUES [[PTRTOINT]](s32), [[LOAD]](s32)
474 ; VI: [[SELECT:%[0-9]+]]:_(p0) = G_SELECT [[ICMP]](s1), [[MV]], [[C1]]
475 ; VI: [[COPY3:%[0-9]+]]:_(p4) = COPY [[COPY]](p4)
476 ; VI: [[GEP1:%[0-9]+]]:_(p4) = G_GEP [[COPY3]], [[C2]](s64)
477 ; VI: [[LOAD1:%[0-9]+]]:_(s32) = G_LOAD [[GEP1]](p4) :: (dereferenceable invariant load 4 from `i8 addrspace(4)* undef` + 64, align 64, addrspace 4)
478 ; VI: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](p3), [[C]]
479 ; VI: [[PTRTOINT1:%[0-9]+]]:_(s32) = G_PTRTOINT [[UV1]](p3)
480 ; VI: [[MV1:%[0-9]+]]:_(p0) = G_MERGE_VALUES [[PTRTOINT1]](s32), [[LOAD1]](s32)
481 ; VI: [[SELECT1:%[0-9]+]]:_(p0) = G_SELECT [[ICMP1]](s1), [[MV1]], [[C1]]
482 ; VI: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p0>) = G_BUILD_VECTOR [[SELECT]](p0), [[SELECT1]](p0)
483 ; VI: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x p0>)
484 ; GFX9-LABEL: name: test_addrspacecast_v2p3_to_v2p0
485 ; GFX9: [[COPY:%[0-9]+]]:_(<2 x p3>) = COPY $vgpr0_vgpr1
486 ; GFX9: [[UV:%[0-9]+]]:_(p3), [[UV1:%[0-9]+]]:_(p3) = G_UNMERGE_VALUES [[COPY]](<2 x p3>)
487 ; GFX9: [[C:%[0-9]+]]:_(p3) = G_CONSTANT i32 -1
488 ; GFX9: [[C1:%[0-9]+]]:_(p0) = G_CONSTANT i64 0
489 ; GFX9: [[S_GETREG_B32_:%[0-9]+]]:sreg_32(s32) = S_GETREG_B32 31759
490 ; GFX9: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
491 ; GFX9: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[S_GETREG_B32_]], [[C2]](s32)
492 ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](p3), [[C]]
493 ; GFX9: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[UV]](p3)
494 ; GFX9: [[MV:%[0-9]+]]:_(p0) = G_MERGE_VALUES [[PTRTOINT]](s32), [[SHL]](s32)
495 ; GFX9: [[SELECT:%[0-9]+]]:_(p0) = G_SELECT [[ICMP]](s1), [[MV]], [[C1]]
496 ; GFX9: [[S_GETREG_B32_1:%[0-9]+]]:sreg_32(s32) = S_GETREG_B32 31759
497 ; GFX9: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[S_GETREG_B32_1]], [[C2]](s32)
498 ; GFX9: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](p3), [[C]]
499 ; GFX9: [[PTRTOINT1:%[0-9]+]]:_(s32) = G_PTRTOINT [[UV1]](p3)
500 ; GFX9: [[MV1:%[0-9]+]]:_(p0) = G_MERGE_VALUES [[PTRTOINT1]](s32), [[SHL1]](s32)
501 ; GFX9: [[SELECT1:%[0-9]+]]:_(p0) = G_SELECT [[ICMP1]](s1), [[MV1]], [[C1]]
502 ; GFX9: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p0>) = G_BUILD_VECTOR [[SELECT]](p0), [[SELECT1]](p0)
503 ; GFX9: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x p0>)
504 ; SI-LABEL: name: test_addrspacecast_v2p3_to_v2p0
505 ; SI: [[COPY:%[0-9]+]]:_(<2 x p3>) = COPY $vgpr0_vgpr1
506 ; SI: [[UV:%[0-9]+]]:_(p3), [[UV1:%[0-9]+]]:_(p3) = G_UNMERGE_VALUES [[COPY]](<2 x p3>)
507 ; SI: [[ADDRSPACE_CAST:%[0-9]+]]:_(p0) = G_ADDRSPACE_CAST [[UV]](p3)
508 ; SI: [[ADDRSPACE_CAST1:%[0-9]+]]:_(p0) = G_ADDRSPACE_CAST [[UV1]](p3)
509 ; SI: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p0>) = G_BUILD_VECTOR [[ADDRSPACE_CAST]](p0), [[ADDRSPACE_CAST1]](p0)
510 ; SI: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x p0>)
511 %0:_(<2 x p3>) = COPY $vgpr0_vgpr1
512 %1:_(<2 x p0>) = G_ADDRSPACE_CAST %0
513 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1
517 name: test_addrspacecast_p4_to_p6
520 liveins: $vgpr0_vgpr1
522 ; VI-LABEL: name: test_addrspacecast_p4_to_p6
523 ; VI: [[COPY:%[0-9]+]]:_(p4) = COPY $vgpr0_vgpr1
524 ; VI: [[EXTRACT:%[0-9]+]]:_(p6) = G_EXTRACT [[COPY]](p4), 0
525 ; VI: $vgpr0 = COPY [[EXTRACT]](p6)
526 ; GFX9-LABEL: name: test_addrspacecast_p4_to_p6
527 ; GFX9: [[COPY:%[0-9]+]]:_(p4) = COPY $vgpr0_vgpr1
528 ; GFX9: [[EXTRACT:%[0-9]+]]:_(p6) = G_EXTRACT [[COPY]](p4), 0
529 ; GFX9: $vgpr0 = COPY [[EXTRACT]](p6)
530 ; SI-LABEL: name: test_addrspacecast_p4_to_p6
531 ; SI: [[COPY:%[0-9]+]]:_(p4) = COPY $vgpr0_vgpr1
532 ; SI: [[EXTRACT:%[0-9]+]]:_(p6) = G_EXTRACT [[COPY]](p4), 0
533 ; SI: $vgpr0 = COPY [[EXTRACT]](p6)
534 %0:_(p4) = COPY $vgpr0_vgpr1
535 %1:_(p6) = G_ADDRSPACE_CAST %0
540 name: test_addrspacecast_p6_to_p4_0
545 ; VI-LABEL: name: test_addrspacecast_p6_to_p4_0
546 ; VI: [[COPY:%[0-9]+]]:_(p6) = COPY $vgpr0
547 ; VI: [[C:%[0-9]+]]:_(p6) = G_CONSTANT i32 0
548 ; VI: [[MV:%[0-9]+]]:_(p4) = G_MERGE_VALUES [[COPY]](p6), [[C]](p6)
549 ; VI: $vgpr0_vgpr1 = COPY [[MV]](p4)
550 ; GFX9-LABEL: name: test_addrspacecast_p6_to_p4_0
551 ; GFX9: [[COPY:%[0-9]+]]:_(p6) = COPY $vgpr0
552 ; GFX9: [[C:%[0-9]+]]:_(p6) = G_CONSTANT i32 0
553 ; GFX9: [[MV:%[0-9]+]]:_(p4) = G_MERGE_VALUES [[COPY]](p6), [[C]](p6)
554 ; GFX9: $vgpr0_vgpr1 = COPY [[MV]](p4)
555 ; SI-LABEL: name: test_addrspacecast_p6_to_p4_0
556 ; SI: [[COPY:%[0-9]+]]:_(p6) = COPY $vgpr0
557 ; SI: [[C:%[0-9]+]]:_(p6) = G_CONSTANT i32 0
558 ; SI: [[MV:%[0-9]+]]:_(p4) = G_MERGE_VALUES [[COPY]](p6), [[C]](p6)
559 ; SI: $vgpr0_vgpr1 = COPY [[MV]](p4)
560 %0:_(p6) = COPY $vgpr0
561 %1:_(p4) = G_ADDRSPACE_CAST %0
562 $vgpr0_vgpr1 = COPY %1
566 name: test_addrspacecast_p6_to_p4_0xdeadbeef
568 highBitsOf32BitAddress: 0xdeadbeef
573 ; VI-LABEL: name: test_addrspacecast_p6_to_p4_0xdeadbeef
574 ; VI: [[COPY:%[0-9]+]]:_(p6) = COPY $vgpr0
575 ; VI: [[C:%[0-9]+]]:_(p6) = G_CONSTANT i32 -559038737
576 ; VI: [[MV:%[0-9]+]]:_(p4) = G_MERGE_VALUES [[COPY]](p6), [[C]](p6)
577 ; VI: $vgpr0_vgpr1 = COPY [[MV]](p4)
578 ; GFX9-LABEL: name: test_addrspacecast_p6_to_p4_0xdeadbeef
579 ; GFX9: [[COPY:%[0-9]+]]:_(p6) = COPY $vgpr0
580 ; GFX9: [[C:%[0-9]+]]:_(p6) = G_CONSTANT i32 -559038737
581 ; GFX9: [[MV:%[0-9]+]]:_(p4) = G_MERGE_VALUES [[COPY]](p6), [[C]](p6)
582 ; GFX9: $vgpr0_vgpr1 = COPY [[MV]](p4)
583 ; SI-LABEL: name: test_addrspacecast_p6_to_p4_0xdeadbeef
584 ; SI: [[COPY:%[0-9]+]]:_(p6) = COPY $vgpr0
585 ; SI: [[C:%[0-9]+]]:_(p6) = G_CONSTANT i32 -559038737
586 ; SI: [[MV:%[0-9]+]]:_(p4) = G_MERGE_VALUES [[COPY]](p6), [[C]](p6)
587 ; SI: $vgpr0_vgpr1 = COPY [[MV]](p4)
588 %0:_(p6) = COPY $vgpr0
589 %1:_(p4) = G_ADDRSPACE_CAST %0
590 $vgpr0_vgpr1 = COPY %1
594 name: test_addrspacecast_p0_to_p6
597 liveins: $vgpr0_vgpr1
599 ; VI-LABEL: name: test_addrspacecast_p0_to_p6
600 ; VI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
601 ; VI: [[EXTRACT:%[0-9]+]]:_(p6) = G_EXTRACT [[COPY]](p0), 0
602 ; VI: $vgpr0 = COPY [[EXTRACT]](p6)
603 ; GFX9-LABEL: name: test_addrspacecast_p0_to_p6
604 ; GFX9: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
605 ; GFX9: [[EXTRACT:%[0-9]+]]:_(p6) = G_EXTRACT [[COPY]](p0), 0
606 ; GFX9: $vgpr0 = COPY [[EXTRACT]](p6)
607 ; SI-LABEL: name: test_addrspacecast_p0_to_p6
608 ; SI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
609 ; SI: [[EXTRACT:%[0-9]+]]:_(p6) = G_EXTRACT [[COPY]](p0), 0
610 ; SI: $vgpr0 = COPY [[EXTRACT]](p6)
611 %0:_(p0) = COPY $vgpr0_vgpr1
612 %1:_(p6) = G_ADDRSPACE_CAST %0
617 name: test_addrspacecast_p6_to_p0
622 ; VI-LABEL: name: test_addrspacecast_p6_to_p0
623 ; VI: [[COPY:%[0-9]+]]:_(p6) = COPY $vgpr0
624 ; VI: [[C:%[0-9]+]]:_(p6) = G_CONSTANT i32 0
625 ; VI: [[MV:%[0-9]+]]:_(p0) = G_MERGE_VALUES [[COPY]](p6), [[C]](p6)
626 ; VI: $vgpr0_vgpr1 = COPY [[MV]](p0)
627 ; GFX9-LABEL: name: test_addrspacecast_p6_to_p0
628 ; GFX9: [[COPY:%[0-9]+]]:_(p6) = COPY $vgpr0
629 ; GFX9: [[C:%[0-9]+]]:_(p6) = G_CONSTANT i32 0
630 ; GFX9: [[MV:%[0-9]+]]:_(p0) = G_MERGE_VALUES [[COPY]](p6), [[C]](p6)
631 ; GFX9: $vgpr0_vgpr1 = COPY [[MV]](p0)
632 ; SI-LABEL: name: test_addrspacecast_p6_to_p0
633 ; SI: [[COPY:%[0-9]+]]:_(p6) = COPY $vgpr0
634 ; SI: [[C:%[0-9]+]]:_(p6) = G_CONSTANT i32 0
635 ; SI: [[MV:%[0-9]+]]:_(p0) = G_MERGE_VALUES [[COPY]](p6), [[C]](p6)
636 ; SI: $vgpr0_vgpr1 = COPY [[MV]](p0)
637 %0:_(p6) = COPY $vgpr0
638 %1:_(p0) = G_ADDRSPACE_CAST %0
639 $vgpr0_vgpr1 = COPY %1