• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -march=amdgcn -mcpu=fiji -O0 -run-pass=legalizer -o - %s  | FileCheck -check-prefix=VI %s
3# RUN: llc -march=amdgcn -mcpu=gfx900 -O0 -run-pass=legalizer -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
5
6---
7name: test_addrspacecast_p0_to_p1
8machineFunctionInfo:
9  argumentInfo:
10    queuePtr: { reg: '$sgpr4_sgpr5' }
11
12body: |
13  bb.0:
14    liveins: $vgpr0_vgpr1
15
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
31...
32
33---
34name: test_addrspacecast_p1_to_p0
35machineFunctionInfo:
36  argumentInfo:
37    queuePtr: { reg: '$sgpr4_sgpr5' }
38
39body: |
40  bb.0:
41    liveins: $vgpr0_vgpr1
42
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
58...
59
60---
61name: test_addrspacecast_p0_to_p4
62machineFunctionInfo:
63  argumentInfo:
64    queuePtr: { reg: '$sgpr4_sgpr5' }
65body: |
66  bb.0:
67    liveins: $vgpr0_vgpr1
68
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
84...
85
86---
87name: test_addrspacecast_p4_to_p0
88machineFunctionInfo:
89  argumentInfo:
90    queuePtr: { reg: '$sgpr4_sgpr5' }
91body: |
92  bb.0:
93    liveins: $vgpr0_vgpr1
94
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
110...
111
112---
113name: test_addrspacecast_p0_to_p999
114machineFunctionInfo:
115  argumentInfo:
116    queuePtr: { reg: '$sgpr4_sgpr5' }
117body: |
118  bb.0:
119    liveins: $vgpr0_vgpr1
120
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
136...
137
138---
139name: test_addrspacecast_p999_to_p0
140machineFunctionInfo:
141  argumentInfo:
142    queuePtr: { reg: '$sgpr4_sgpr5' }
143body: |
144  bb.0:
145    liveins: $vgpr0_vgpr1
146
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
162...
163
164---
165name: test_addrspacecast_p5_to_p0
166machineFunctionInfo:
167  argumentInfo:
168    queuePtr: { reg: '$sgpr4_sgpr5' }
169body: |
170  bb.0:
171    liveins: $vgpr0
172
173    ; VI-LABEL: name: test_addrspacecast_p5_to_p0
174    ; VI: [[COPY:%[0-9]+]]:sgpr_64(p4) = COPY $sgpr4_sgpr5
175    ; VI: [[COPY1:%[0-9]+]]:_(p5) = COPY $vgpr0
176    ; VI: [[C:%[0-9]+]]:_(p5) = G_CONSTANT i32 -1
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: [[PTR_ADD:%[0-9]+]]:_(p4) = G_PTR_ADD [[COPY2]], [[C2]](s64)
181    ; VI: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[PTR_ADD]](p4) :: (dereferenceable invariant load 4, 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 -1
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
206...
207
208---
209name: test_addrspacecast_p0_to_p5
210machineFunctionInfo:
211  argumentInfo:
212    queuePtr: { reg: '$sgpr4_sgpr5' }
213body: |
214  bb.0:
215    liveins: $vgpr0_vgpr1
216
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 -1
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 -1
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 -1
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
243    $vgpr0 = COPY %1
244...
245
246---
247name: test_addrspacecast_p3_to_p0
248machineFunctionInfo:
249  argumentInfo:
250    queuePtr: { reg: '$sgpr4_sgpr5' }
251
252body: |
253  bb.0:
254    liveins: $vgpr0
255
256    ; VI-LABEL: name: test_addrspacecast_p3_to_p0
257    ; VI: [[COPY:%[0-9]+]]:sgpr_64(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: [[PTR_ADD:%[0-9]+]]:_(p4) = G_PTR_ADD [[COPY2]], [[C2]](s64)
264    ; VI: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[PTR_ADD]](p4) :: (dereferenceable invariant load 4, 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
289...
290
291---
292name: test_addrspacecast_p0_to_p3
293machineFunctionInfo:
294  argumentInfo:
295    queuePtr: { reg: '$sgpr4_sgpr5' }
296body: |
297  bb.0:
298    liveins: $vgpr0_vgpr1
299
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
326    $vgpr0 = COPY %1
327...
328
329---
330name: test_addrspacecast_v2p0_to_v2p1
331machineFunctionInfo:
332  argumentInfo:
333    queuePtr: { reg: '$sgpr4_sgpr5' }
334body: |
335  bb.0:
336    liveins: $vgpr0_vgpr1_vgpr2_vgpr3
337
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
362...
363
364---
365name: test_addrspacecast_v2p1_to_v2p0
366machineFunctionInfo:
367  argumentInfo:
368    queuePtr: { reg: '$sgpr4_sgpr5' }
369body: |
370  bb.0:
371    liveins: $vgpr0_vgpr1_vgpr2_vgpr3
372
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
397...
398
399---
400name: test_addrspacecast_v2p0_to_v2p3
401machineFunctionInfo:
402  argumentInfo:
403    queuePtr: { reg: '$sgpr4_sgpr5' }
404body: |
405  bb.0:
406    liveins: $vgpr0_vgpr1_vgpr2_vgpr3
407
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
450...
451
452---
453name: test_addrspacecast_v2p3_to_v2p0
454machineFunctionInfo:
455  argumentInfo:
456    queuePtr: { reg: '$sgpr4_sgpr5' }
457body: |
458  bb.0:
459    liveins: $vgpr0_vgpr1
460
461    ; VI-LABEL: name: test_addrspacecast_v2p3_to_v2p0
462    ; VI: [[COPY:%[0-9]+]]:sgpr_64(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: [[PTR_ADD:%[0-9]+]]:_(p4) = G_PTR_ADD [[COPY2]], [[C2]](s64)
470    ; VI: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[PTR_ADD]](p4) :: (dereferenceable invariant load 4, 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: [[PTR_ADD1:%[0-9]+]]:_(p4) = G_PTR_ADD [[COPY3]], [[C2]](s64)
477    ; VI: [[LOAD1:%[0-9]+]]:_(s32) = G_LOAD [[PTR_ADD1]](p4) :: (dereferenceable invariant load 4, 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
514...
515
516---
517name: test_addrspacecast_p4_to_p6
518body: |
519  bb.0:
520    liveins: $vgpr0_vgpr1
521
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
536    $vgpr0 = COPY %1
537...
538
539---
540name: test_addrspacecast_p6_to_p4_0
541body: |
542  bb.0:
543    liveins: $vgpr0
544
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
563...
564
565---
566name: test_addrspacecast_p6_to_p4_0xdeadbeef
567machineFunctionInfo:
568  highBitsOf32BitAddress: 0xdeadbeef
569body: |
570  bb.0:
571    liveins: $vgpr0
572
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
591...
592
593---
594name: test_addrspacecast_p0_to_p6
595body: |
596  bb.0:
597    liveins: $vgpr0_vgpr1
598
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
613    $vgpr0 = COPY %1
614...
615
616---
617name: test_addrspacecast_p6_to_p0
618body: |
619  bb.0:
620    liveins: $vgpr0
621
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
640...
641