1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn -mcpu=tahiti -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -disable-gisel-legality-check -o - %s | FileCheck -check-prefix=GFX6 %s
3 # RUN: llc -mtriple=amdgcn -mcpu=hawaii -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX7 %s
4 # RUN: llc -mtriple=amdgcn -mcpu=fiji -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX7 %s
5 # RUN: llc -mtriple=amdgcn -mcpu=gfx900 -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX9 %s
6 # RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -mattr=+cumode -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX10 %s
7 # RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX9 %s
11 name: load_local_s32_from_4
14 tracksRegLiveness: true
20 ; GFX6-LABEL: name: load_local_s32_from_4
21 ; GFX6: liveins: $vgpr0
23 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
24 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
25 ; GFX6-NEXT: [[DS_READ_B32_:%[0-9]+]]:vgpr_32 = DS_READ_B32 [[COPY]], 0, 0, implicit $m0, implicit $exec :: (load (s32), addrspace 3)
26 ; GFX6-NEXT: $vgpr0 = COPY [[DS_READ_B32_]]
27 ; GFX7-LABEL: name: load_local_s32_from_4
28 ; GFX7: liveins: $vgpr0
30 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
31 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
32 ; GFX7-NEXT: [[DS_READ_B32_:%[0-9]+]]:vgpr_32 = DS_READ_B32 [[COPY]], 0, 0, implicit $m0, implicit $exec :: (load (s32), addrspace 3)
33 ; GFX7-NEXT: $vgpr0 = COPY [[DS_READ_B32_]]
34 ; GFX9-LABEL: name: load_local_s32_from_4
35 ; GFX9: liveins: $vgpr0
37 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
38 ; GFX9-NEXT: [[DS_READ_B32_gfx9_:%[0-9]+]]:vgpr_32 = DS_READ_B32_gfx9 [[COPY]], 0, 0, implicit $exec :: (load (s32), addrspace 3)
39 ; GFX9-NEXT: $vgpr0 = COPY [[DS_READ_B32_gfx9_]]
40 ; GFX10-LABEL: name: load_local_s32_from_4
41 ; GFX10: liveins: $vgpr0
43 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
44 ; GFX10-NEXT: [[DS_READ_B32_gfx9_:%[0-9]+]]:vgpr_32 = DS_READ_B32_gfx9 [[COPY]], 0, 0, implicit $exec :: (load (s32), addrspace 3)
45 ; GFX10-NEXT: $vgpr0 = COPY [[DS_READ_B32_gfx9_]]
46 %0:vgpr(p3) = COPY $vgpr0
47 %1:vgpr(s32) = G_LOAD %0 :: (load (s32), align 4, addrspace 3)
54 name: load_local_s32_from_2
57 tracksRegLiveness: true
63 ; GFX6-LABEL: name: load_local_s32_from_2
64 ; GFX6: liveins: $vgpr0
66 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
67 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
68 ; GFX6-NEXT: [[DS_READ_U16_:%[0-9]+]]:vgpr_32 = DS_READ_U16 [[COPY]], 0, 0, implicit $m0, implicit $exec :: (load (s16), addrspace 3)
69 ; GFX6-NEXT: $vgpr0 = COPY [[DS_READ_U16_]]
70 ; GFX7-LABEL: name: load_local_s32_from_2
71 ; GFX7: liveins: $vgpr0
73 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
74 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
75 ; GFX7-NEXT: [[DS_READ_U16_:%[0-9]+]]:vgpr_32 = DS_READ_U16 [[COPY]], 0, 0, implicit $m0, implicit $exec :: (load (s16), addrspace 3)
76 ; GFX7-NEXT: $vgpr0 = COPY [[DS_READ_U16_]]
77 ; GFX9-LABEL: name: load_local_s32_from_2
78 ; GFX9: liveins: $vgpr0
80 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
81 ; GFX9-NEXT: [[DS_READ_U16_gfx9_:%[0-9]+]]:vgpr_32 = DS_READ_U16_gfx9 [[COPY]], 0, 0, implicit $exec :: (load (s16), addrspace 3)
82 ; GFX9-NEXT: $vgpr0 = COPY [[DS_READ_U16_gfx9_]]
83 ; GFX10-LABEL: name: load_local_s32_from_2
84 ; GFX10: liveins: $vgpr0
86 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
87 ; GFX10-NEXT: [[DS_READ_U16_gfx9_:%[0-9]+]]:vgpr_32 = DS_READ_U16_gfx9 [[COPY]], 0, 0, implicit $exec :: (load (s16), addrspace 3)
88 ; GFX10-NEXT: $vgpr0 = COPY [[DS_READ_U16_gfx9_]]
89 %0:vgpr(p3) = COPY $vgpr0
90 %1:vgpr(s32) = G_LOAD %0 :: (load (s16), align 2, addrspace 3)
97 name: load_local_s32_from_1
100 tracksRegLiveness: true
102 scratchRSrcReg: $sgpr0_sgpr1_sgpr2_sgpr3
103 stackPtrOffsetReg: $sgpr32
109 ; GFX6-LABEL: name: load_local_s32_from_1
110 ; GFX6: liveins: $vgpr0
112 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
113 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
114 ; GFX6-NEXT: [[DS_READ_U8_:%[0-9]+]]:vgpr_32 = DS_READ_U8 [[COPY]], 0, 0, implicit $m0, implicit $exec :: (load (s8), addrspace 3)
115 ; GFX6-NEXT: $vgpr0 = COPY [[DS_READ_U8_]]
116 ; GFX7-LABEL: name: load_local_s32_from_1
117 ; GFX7: liveins: $vgpr0
119 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
120 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
121 ; GFX7-NEXT: [[DS_READ_U8_:%[0-9]+]]:vgpr_32 = DS_READ_U8 [[COPY]], 0, 0, implicit $m0, implicit $exec :: (load (s8), addrspace 3)
122 ; GFX7-NEXT: $vgpr0 = COPY [[DS_READ_U8_]]
123 ; GFX9-LABEL: name: load_local_s32_from_1
124 ; GFX9: liveins: $vgpr0
126 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
127 ; GFX9-NEXT: [[DS_READ_U8_gfx9_:%[0-9]+]]:vgpr_32 = DS_READ_U8_gfx9 [[COPY]], 0, 0, implicit $exec :: (load (s8), addrspace 3)
128 ; GFX9-NEXT: $vgpr0 = COPY [[DS_READ_U8_gfx9_]]
129 ; GFX10-LABEL: name: load_local_s32_from_1
130 ; GFX10: liveins: $vgpr0
132 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
133 ; GFX10-NEXT: [[DS_READ_U8_gfx9_:%[0-9]+]]:vgpr_32 = DS_READ_U8_gfx9 [[COPY]], 0, 0, implicit $exec :: (load (s8), addrspace 3)
134 ; GFX10-NEXT: $vgpr0 = COPY [[DS_READ_U8_gfx9_]]
135 %0:vgpr(p3) = COPY $vgpr0
136 %1:vgpr(s32) = G_LOAD %0 :: (load (s8), align 1, addrspace 3)
143 name: load_local_v2s32
145 regBankSelected: true
146 tracksRegLiveness: true
152 ; GFX6-LABEL: name: load_local_v2s32
153 ; GFX6: liveins: $vgpr0
155 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
156 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
157 ; GFX6-NEXT: [[DS_READ_B64_:%[0-9]+]]:vreg_64 = DS_READ_B64 [[COPY]], 0, 0, implicit $m0, implicit $exec :: (load (<2 x s32>), addrspace 3)
158 ; GFX6-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ_B64_]]
159 ; GFX7-LABEL: name: load_local_v2s32
160 ; GFX7: liveins: $vgpr0
162 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
163 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
164 ; GFX7-NEXT: [[DS_READ_B64_:%[0-9]+]]:vreg_64 = DS_READ_B64 [[COPY]], 0, 0, implicit $m0, implicit $exec :: (load (<2 x s32>), addrspace 3)
165 ; GFX7-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ_B64_]]
166 ; GFX9-LABEL: name: load_local_v2s32
167 ; GFX9: liveins: $vgpr0
169 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
170 ; GFX9-NEXT: [[DS_READ_B64_gfx9_:%[0-9]+]]:vreg_64 = DS_READ_B64_gfx9 [[COPY]], 0, 0, implicit $exec :: (load (<2 x s32>), addrspace 3)
171 ; GFX9-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ_B64_gfx9_]]
172 ; GFX10-LABEL: name: load_local_v2s32
173 ; GFX10: liveins: $vgpr0
175 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
176 ; GFX10-NEXT: [[DS_READ_B64_gfx9_:%[0-9]+]]:vreg_64 = DS_READ_B64_gfx9 [[COPY]], 0, 0, implicit $exec :: (load (<2 x s32>), addrspace 3)
177 ; GFX10-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ_B64_gfx9_]]
178 %0:vgpr(p3) = COPY $vgpr0
179 %1:vgpr(<2 x s32>) = G_LOAD %0 :: (load (<2 x s32>), align 8, addrspace 3)
180 $vgpr0_vgpr1 = COPY %1
186 name: load_local_v2s32_align4
188 regBankSelected: true
189 tracksRegLiveness: true
195 ; GFX6-LABEL: name: load_local_v2s32_align4
196 ; GFX6: liveins: $vgpr0
198 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
199 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
200 ; GFX6-NEXT: [[LOAD:%[0-9]+]]:vreg_64(<2 x s32>) = G_LOAD [[COPY]](p3) :: (load (<2 x s32>), align 4, addrspace 3)
201 ; GFX6-NEXT: $vgpr0_vgpr1 = COPY [[LOAD]](<2 x s32>)
202 ; GFX7-LABEL: name: load_local_v2s32_align4
203 ; GFX7: liveins: $vgpr0
205 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
206 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
207 ; GFX7-NEXT: [[DS_READ2_B32_:%[0-9]+]]:vreg_64 = DS_READ2_B32 [[COPY]], 0, 1, 0, implicit $m0, implicit $exec :: (load (<2 x s32>), align 4, addrspace 3)
208 ; GFX7-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ2_B32_]]
209 ; GFX9-LABEL: name: load_local_v2s32_align4
210 ; GFX9: liveins: $vgpr0
212 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
213 ; GFX9-NEXT: [[DS_READ2_B32_gfx9_:%[0-9]+]]:vreg_64 = DS_READ2_B32_gfx9 [[COPY]], 0, 1, 0, implicit $exec :: (load (<2 x s32>), align 4, addrspace 3)
214 ; GFX9-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ2_B32_gfx9_]]
215 ; GFX10-LABEL: name: load_local_v2s32_align4
216 ; GFX10: liveins: $vgpr0
218 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
219 ; GFX10-NEXT: [[DS_READ2_B32_gfx9_:%[0-9]+]]:vreg_64 = DS_READ2_B32_gfx9 [[COPY]], 0, 1, 0, implicit $exec :: (load (<2 x s32>), align 4, addrspace 3)
220 ; GFX10-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ2_B32_gfx9_]]
221 %0:vgpr(p3) = COPY $vgpr0
222 %1:vgpr(<2 x s32>) = G_LOAD %0 :: (load (<2 x s32>), align 4, addrspace 3)
223 $vgpr0_vgpr1 = COPY %1
231 regBankSelected: true
232 tracksRegLiveness: true
238 ; GFX6-LABEL: name: load_local_s64
239 ; GFX6: liveins: $vgpr0
241 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
242 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
243 ; GFX6-NEXT: [[DS_READ_B64_:%[0-9]+]]:vreg_64 = DS_READ_B64 [[COPY]], 0, 0, implicit $m0, implicit $exec :: (load (s64), addrspace 3)
244 ; GFX6-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ_B64_]]
245 ; GFX7-LABEL: name: load_local_s64
246 ; GFX7: liveins: $vgpr0
248 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
249 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
250 ; GFX7-NEXT: [[DS_READ_B64_:%[0-9]+]]:vreg_64 = DS_READ_B64 [[COPY]], 0, 0, implicit $m0, implicit $exec :: (load (s64), addrspace 3)
251 ; GFX7-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ_B64_]]
252 ; GFX9-LABEL: name: load_local_s64
253 ; GFX9: liveins: $vgpr0
255 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
256 ; GFX9-NEXT: [[DS_READ_B64_gfx9_:%[0-9]+]]:vreg_64 = DS_READ_B64_gfx9 [[COPY]], 0, 0, implicit $exec :: (load (s64), addrspace 3)
257 ; GFX9-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ_B64_gfx9_]]
258 ; GFX10-LABEL: name: load_local_s64
259 ; GFX10: liveins: $vgpr0
261 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
262 ; GFX10-NEXT: [[DS_READ_B64_gfx9_:%[0-9]+]]:vreg_64 = DS_READ_B64_gfx9 [[COPY]], 0, 0, implicit $exec :: (load (s64), addrspace 3)
263 ; GFX10-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ_B64_gfx9_]]
264 %0:vgpr(p3) = COPY $vgpr0
265 %1:vgpr(s64) = G_LOAD %0 :: (load (s64), align 8, addrspace 3)
266 $vgpr0_vgpr1 = COPY %1
272 name: load_local_s64_align4
274 regBankSelected: true
275 tracksRegLiveness: true
281 ; GFX6-LABEL: name: load_local_s64_align4
282 ; GFX6: liveins: $vgpr0
284 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
285 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
286 ; GFX6-NEXT: [[LOAD:%[0-9]+]]:vreg_64(s64) = G_LOAD [[COPY]](p3) :: (load (s64), align 4, addrspace 3)
287 ; GFX6-NEXT: $vgpr0_vgpr1 = COPY [[LOAD]](s64)
288 ; GFX7-LABEL: name: load_local_s64_align4
289 ; GFX7: liveins: $vgpr0
291 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
292 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
293 ; GFX7-NEXT: [[DS_READ2_B32_:%[0-9]+]]:vreg_64 = DS_READ2_B32 [[COPY]], 0, 1, 0, implicit $m0, implicit $exec :: (load (s64), align 4, addrspace 3)
294 ; GFX7-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ2_B32_]]
295 ; GFX9-LABEL: name: load_local_s64_align4
296 ; GFX9: liveins: $vgpr0
298 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
299 ; GFX9-NEXT: [[DS_READ2_B32_gfx9_:%[0-9]+]]:vreg_64 = DS_READ2_B32_gfx9 [[COPY]], 0, 1, 0, implicit $exec :: (load (s64), align 4, addrspace 3)
300 ; GFX9-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ2_B32_gfx9_]]
301 ; GFX10-LABEL: name: load_local_s64_align4
302 ; GFX10: liveins: $vgpr0
304 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
305 ; GFX10-NEXT: [[DS_READ2_B32_gfx9_:%[0-9]+]]:vreg_64 = DS_READ2_B32_gfx9 [[COPY]], 0, 1, 0, implicit $exec :: (load (s64), align 4, addrspace 3)
306 ; GFX10-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ2_B32_gfx9_]]
307 %0:vgpr(p3) = COPY $vgpr0
308 %1:vgpr(s64) = G_LOAD %0 :: (load (s64), align 4, addrspace 3)
309 $vgpr0_vgpr1 = COPY %1
315 name: load_local_p3_from_4
317 regBankSelected: true
318 tracksRegLiveness: true
324 ; GFX6-LABEL: name: load_local_p3_from_4
325 ; GFX6: liveins: $vgpr0
327 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
328 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
329 ; GFX6-NEXT: [[DS_READ_B32_:%[0-9]+]]:vgpr_32 = DS_READ_B32 [[COPY]], 0, 0, implicit $m0, implicit $exec :: (load (p3), addrspace 3)
330 ; GFX6-NEXT: $vgpr0 = COPY [[DS_READ_B32_]]
331 ; GFX7-LABEL: name: load_local_p3_from_4
332 ; GFX7: liveins: $vgpr0
334 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
335 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
336 ; GFX7-NEXT: [[DS_READ_B32_:%[0-9]+]]:vgpr_32 = DS_READ_B32 [[COPY]], 0, 0, implicit $m0, implicit $exec :: (load (p3), addrspace 3)
337 ; GFX7-NEXT: $vgpr0 = COPY [[DS_READ_B32_]]
338 ; GFX9-LABEL: name: load_local_p3_from_4
339 ; GFX9: liveins: $vgpr0
341 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
342 ; GFX9-NEXT: [[DS_READ_B32_gfx9_:%[0-9]+]]:vgpr_32 = DS_READ_B32_gfx9 [[COPY]], 0, 0, implicit $exec :: (load (p3), addrspace 3)
343 ; GFX9-NEXT: $vgpr0 = COPY [[DS_READ_B32_gfx9_]]
344 ; GFX10-LABEL: name: load_local_p3_from_4
345 ; GFX10: liveins: $vgpr0
347 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
348 ; GFX10-NEXT: [[DS_READ_B32_gfx9_:%[0-9]+]]:vgpr_32 = DS_READ_B32_gfx9 [[COPY]], 0, 0, implicit $exec :: (load (p3), addrspace 3)
349 ; GFX10-NEXT: $vgpr0 = COPY [[DS_READ_B32_gfx9_]]
350 %0:vgpr(p3) = COPY $vgpr0
351 %1:vgpr(p3) = G_LOAD %0 :: (load (p3), align 4, addrspace 3)
358 name: load_local_p5_from_4
360 regBankSelected: true
361 tracksRegLiveness: true
367 ; GFX6-LABEL: name: load_local_p5_from_4
368 ; GFX6: liveins: $vgpr0
370 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
371 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
372 ; GFX6-NEXT: [[DS_READ_B32_:%[0-9]+]]:vgpr_32 = DS_READ_B32 [[COPY]], 0, 0, implicit $m0, implicit $exec :: (load (p5), addrspace 3)
373 ; GFX6-NEXT: $vgpr0 = COPY [[DS_READ_B32_]]
374 ; GFX7-LABEL: name: load_local_p5_from_4
375 ; GFX7: liveins: $vgpr0
377 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
378 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
379 ; GFX7-NEXT: [[DS_READ_B32_:%[0-9]+]]:vgpr_32 = DS_READ_B32 [[COPY]], 0, 0, implicit $m0, implicit $exec :: (load (p5), addrspace 3)
380 ; GFX7-NEXT: $vgpr0 = COPY [[DS_READ_B32_]]
381 ; GFX9-LABEL: name: load_local_p5_from_4
382 ; GFX9: liveins: $vgpr0
384 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
385 ; GFX9-NEXT: [[DS_READ_B32_gfx9_:%[0-9]+]]:vgpr_32 = DS_READ_B32_gfx9 [[COPY]], 0, 0, implicit $exec :: (load (p5), addrspace 3)
386 ; GFX9-NEXT: $vgpr0 = COPY [[DS_READ_B32_gfx9_]]
387 ; GFX10-LABEL: name: load_local_p5_from_4
388 ; GFX10: liveins: $vgpr0
390 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
391 ; GFX10-NEXT: [[DS_READ_B32_gfx9_:%[0-9]+]]:vgpr_32 = DS_READ_B32_gfx9 [[COPY]], 0, 0, implicit $exec :: (load (p5), addrspace 3)
392 ; GFX10-NEXT: $vgpr0 = COPY [[DS_READ_B32_gfx9_]]
393 %0:vgpr(p3) = COPY $vgpr0
394 %1:vgpr(p5) = G_LOAD %0 :: (load (p5), align 4, addrspace 3)
401 name: load_local_p1_align8
403 regBankSelected: true
404 tracksRegLiveness: true
410 ; GFX6-LABEL: name: load_local_p1_align8
411 ; GFX6: liveins: $vgpr0
413 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
414 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
415 ; GFX6-NEXT: [[DS_READ_B64_:%[0-9]+]]:vreg_64 = DS_READ_B64 [[COPY]], 0, 0, implicit $m0, implicit $exec :: (load (p1), addrspace 3)
416 ; GFX6-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ_B64_]]
417 ; GFX7-LABEL: name: load_local_p1_align8
418 ; GFX7: liveins: $vgpr0
420 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
421 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
422 ; GFX7-NEXT: [[DS_READ_B64_:%[0-9]+]]:vreg_64 = DS_READ_B64 [[COPY]], 0, 0, implicit $m0, implicit $exec :: (load (p1), addrspace 3)
423 ; GFX7-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ_B64_]]
424 ; GFX9-LABEL: name: load_local_p1_align8
425 ; GFX9: liveins: $vgpr0
427 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
428 ; GFX9-NEXT: [[DS_READ_B64_gfx9_:%[0-9]+]]:vreg_64 = DS_READ_B64_gfx9 [[COPY]], 0, 0, implicit $exec :: (load (p1), addrspace 3)
429 ; GFX9-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ_B64_gfx9_]]
430 ; GFX10-LABEL: name: load_local_p1_align8
431 ; GFX10: liveins: $vgpr0
433 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
434 ; GFX10-NEXT: [[DS_READ_B64_gfx9_:%[0-9]+]]:vreg_64 = DS_READ_B64_gfx9 [[COPY]], 0, 0, implicit $exec :: (load (p1), addrspace 3)
435 ; GFX10-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ_B64_gfx9_]]
436 %0:vgpr(p3) = COPY $vgpr0
437 %1:vgpr(p1) = G_LOAD %0 :: (load (p1), align 8, addrspace 3)
438 $vgpr0_vgpr1 = COPY %1
444 name: load_local_p1_align4
446 regBankSelected: true
447 tracksRegLiveness: true
453 ; GFX6-LABEL: name: load_local_p1_align4
454 ; GFX6: liveins: $vgpr0
456 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
457 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
458 ; GFX6-NEXT: [[LOAD:%[0-9]+]]:vreg_64(p1) = G_LOAD [[COPY]](p3) :: (load (p1), align 4, addrspace 3)
459 ; GFX6-NEXT: $vgpr0_vgpr1 = COPY [[LOAD]](p1)
460 ; GFX7-LABEL: name: load_local_p1_align4
461 ; GFX7: liveins: $vgpr0
463 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
464 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
465 ; GFX7-NEXT: [[DS_READ2_B32_:%[0-9]+]]:vreg_64 = DS_READ2_B32 [[COPY]], 0, 1, 0, implicit $m0, implicit $exec :: (load (p1), align 4, addrspace 3)
466 ; GFX7-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ2_B32_]]
467 ; GFX9-LABEL: name: load_local_p1_align4
468 ; GFX9: liveins: $vgpr0
470 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
471 ; GFX9-NEXT: [[DS_READ2_B32_gfx9_:%[0-9]+]]:vreg_64 = DS_READ2_B32_gfx9 [[COPY]], 0, 1, 0, implicit $exec :: (load (p1), align 4, addrspace 3)
472 ; GFX9-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ2_B32_gfx9_]]
473 ; GFX10-LABEL: name: load_local_p1_align4
474 ; GFX10: liveins: $vgpr0
476 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
477 ; GFX10-NEXT: [[DS_READ2_B32_gfx9_:%[0-9]+]]:vreg_64 = DS_READ2_B32_gfx9 [[COPY]], 0, 1, 0, implicit $exec :: (load (p1), align 4, addrspace 3)
478 ; GFX10-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ2_B32_gfx9_]]
479 %0:vgpr(p3) = COPY $vgpr0
480 %1:vgpr(p1) = G_LOAD %0 :: (load (p1), align 4, addrspace 3)
481 $vgpr0_vgpr1 = COPY %1
487 name: load_local_p999_from_8
489 regBankSelected: true
490 tracksRegLiveness: true
496 ; GFX6-LABEL: name: load_local_p999_from_8
497 ; GFX6: liveins: $vgpr0
499 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
500 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
501 ; GFX6-NEXT: [[LOAD:%[0-9]+]]:vreg_64(p999) = G_LOAD [[COPY]](p3) :: (load (p999), addrspace 3)
502 ; GFX6-NEXT: $vgpr0_vgpr1 = COPY [[LOAD]](p999)
503 ; GFX7-LABEL: name: load_local_p999_from_8
504 ; GFX7: liveins: $vgpr0
506 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
507 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
508 ; GFX7-NEXT: [[LOAD:%[0-9]+]]:vreg_64(p999) = G_LOAD [[COPY]](p3) :: (load (p999), addrspace 3)
509 ; GFX7-NEXT: $vgpr0_vgpr1 = COPY [[LOAD]](p999)
510 ; GFX9-LABEL: name: load_local_p999_from_8
511 ; GFX9: liveins: $vgpr0
513 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
514 ; GFX9-NEXT: [[LOAD:%[0-9]+]]:vreg_64(p999) = G_LOAD [[COPY]](p3) :: (load (p999), addrspace 3)
515 ; GFX9-NEXT: $vgpr0_vgpr1 = COPY [[LOAD]](p999)
516 ; GFX10-LABEL: name: load_local_p999_from_8
517 ; GFX10: liveins: $vgpr0
519 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
520 ; GFX10-NEXT: [[LOAD:%[0-9]+]]:vreg_64(p999) = G_LOAD [[COPY]](p3) :: (load (p999), addrspace 3)
521 ; GFX10-NEXT: $vgpr0_vgpr1 = COPY [[LOAD]](p999)
522 %0:vgpr(p3) = COPY $vgpr0
523 %1:vgpr(p999) = G_LOAD %0 :: (load (p999), align 8, addrspace 3)
524 $vgpr0_vgpr1 = COPY %1
530 name: load_local_v2p3
532 regBankSelected: true
533 tracksRegLiveness: true
539 ; GFX6-LABEL: name: load_local_v2p3
540 ; GFX6: liveins: $vgpr0
542 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
543 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
544 ; GFX6-NEXT: [[LOAD:%[0-9]+]]:vreg_64(<2 x p3>) = G_LOAD [[COPY]](p3) :: (load (<2 x p3>), addrspace 3)
545 ; GFX6-NEXT: $vgpr0_vgpr1 = COPY [[LOAD]](<2 x p3>)
546 ; GFX7-LABEL: name: load_local_v2p3
547 ; GFX7: liveins: $vgpr0
549 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
550 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
551 ; GFX7-NEXT: [[LOAD:%[0-9]+]]:vreg_64(<2 x p3>) = G_LOAD [[COPY]](p3) :: (load (<2 x p3>), addrspace 3)
552 ; GFX7-NEXT: $vgpr0_vgpr1 = COPY [[LOAD]](<2 x p3>)
553 ; GFX9-LABEL: name: load_local_v2p3
554 ; GFX9: liveins: $vgpr0
556 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
557 ; GFX9-NEXT: [[LOAD:%[0-9]+]]:vreg_64(<2 x p3>) = G_LOAD [[COPY]](p3) :: (load (<2 x p3>), addrspace 3)
558 ; GFX9-NEXT: $vgpr0_vgpr1 = COPY [[LOAD]](<2 x p3>)
559 ; GFX10-LABEL: name: load_local_v2p3
560 ; GFX10: liveins: $vgpr0
562 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
563 ; GFX10-NEXT: [[LOAD:%[0-9]+]]:vreg_64(<2 x p3>) = G_LOAD [[COPY]](p3) :: (load (<2 x p3>), addrspace 3)
564 ; GFX10-NEXT: $vgpr0_vgpr1 = COPY [[LOAD]](<2 x p3>)
565 %0:vgpr(p3) = COPY $vgpr0
566 %1:vgpr(<2 x p3>) = G_LOAD %0 :: (load (<2 x p3>), align 8, addrspace 3)
567 $vgpr0_vgpr1 = COPY %1
573 name: load_local_v2s16
575 regBankSelected: true
576 tracksRegLiveness: true
582 ; GFX6-LABEL: name: load_local_v2s16
583 ; GFX6: liveins: $vgpr0
585 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
586 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
587 ; GFX6-NEXT: [[DS_READ_B32_:%[0-9]+]]:vgpr_32 = DS_READ_B32 [[COPY]], 0, 0, implicit $m0, implicit $exec :: (load (<2 x s16>), addrspace 3)
588 ; GFX6-NEXT: $vgpr0 = COPY [[DS_READ_B32_]]
589 ; GFX7-LABEL: name: load_local_v2s16
590 ; GFX7: liveins: $vgpr0
592 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
593 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
594 ; GFX7-NEXT: [[DS_READ_B32_:%[0-9]+]]:vgpr_32 = DS_READ_B32 [[COPY]], 0, 0, implicit $m0, implicit $exec :: (load (<2 x s16>), addrspace 3)
595 ; GFX7-NEXT: $vgpr0 = COPY [[DS_READ_B32_]]
596 ; GFX9-LABEL: name: load_local_v2s16
597 ; GFX9: liveins: $vgpr0
599 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
600 ; GFX9-NEXT: [[DS_READ_B32_gfx9_:%[0-9]+]]:vgpr_32 = DS_READ_B32_gfx9 [[COPY]], 0, 0, implicit $exec :: (load (<2 x s16>), addrspace 3)
601 ; GFX9-NEXT: $vgpr0 = COPY [[DS_READ_B32_gfx9_]]
602 ; GFX10-LABEL: name: load_local_v2s16
603 ; GFX10: liveins: $vgpr0
605 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
606 ; GFX10-NEXT: [[DS_READ_B32_gfx9_:%[0-9]+]]:vgpr_32 = DS_READ_B32_gfx9 [[COPY]], 0, 0, implicit $exec :: (load (<2 x s16>), addrspace 3)
607 ; GFX10-NEXT: $vgpr0 = COPY [[DS_READ_B32_gfx9_]]
608 %0:vgpr(p3) = COPY $vgpr0
609 %1:vgpr(<2 x s16>) = G_LOAD %0 :: (load (<2 x s16>), align 4, addrspace 3)
616 name: load_local_v4s16
618 regBankSelected: true
619 tracksRegLiveness: true
625 ; GFX6-LABEL: name: load_local_v4s16
626 ; GFX6: liveins: $vgpr0
628 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
629 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
630 ; GFX6-NEXT: [[DS_READ_B64_:%[0-9]+]]:vreg_64 = DS_READ_B64 [[COPY]], 0, 0, implicit $m0, implicit $exec :: (load (<4 x s16>), addrspace 3)
631 ; GFX6-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ_B64_]]
632 ; GFX7-LABEL: name: load_local_v4s16
633 ; GFX7: liveins: $vgpr0
635 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
636 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
637 ; GFX7-NEXT: [[DS_READ_B64_:%[0-9]+]]:vreg_64 = DS_READ_B64 [[COPY]], 0, 0, implicit $m0, implicit $exec :: (load (<4 x s16>), addrspace 3)
638 ; GFX7-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ_B64_]]
639 ; GFX9-LABEL: name: load_local_v4s16
640 ; GFX9: liveins: $vgpr0
642 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
643 ; GFX9-NEXT: [[DS_READ_B64_gfx9_:%[0-9]+]]:vreg_64 = DS_READ_B64_gfx9 [[COPY]], 0, 0, implicit $exec :: (load (<4 x s16>), addrspace 3)
644 ; GFX9-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ_B64_gfx9_]]
645 ; GFX10-LABEL: name: load_local_v4s16
646 ; GFX10: liveins: $vgpr0
648 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
649 ; GFX10-NEXT: [[DS_READ_B64_gfx9_:%[0-9]+]]:vreg_64 = DS_READ_B64_gfx9 [[COPY]], 0, 0, implicit $exec :: (load (<4 x s16>), addrspace 3)
650 ; GFX10-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ_B64_gfx9_]]
651 %0:vgpr(p3) = COPY $vgpr0
652 %1:vgpr(<4 x s16>) = G_LOAD %0 :: (load (<4 x s16>), align 8, addrspace 3)
653 $vgpr0_vgpr1 = COPY %1
659 # name: load_local_v6s16
661 # regBankSelected: true
662 # tracksRegLiveness: true
663 # machineFunctionInfo:
664 # scratchRSrcReg: $sgpr0_sgpr1_sgpr2_sgpr3
665 # stackPtrOffsetReg: $sgpr32
671 # %0:vgpr(p3) = COPY $vgpr0
672 # %1:vgpr(<6 x s16>) = G_LOAD %0 :: (load (<6 x s16>), align 4, addrspace 3)
673 # $vgpr0_vgpr1_vgpr2 = COPY %1
677 ################################################################################
678 ### Stress addressing modes
679 ################################################################################
683 name: load_local_s32_from_1_gep_65535
685 regBankSelected: true
686 tracksRegLiveness: true
692 ; GFX6-LABEL: name: load_local_s32_from_1_gep_65535
693 ; GFX6: liveins: $vgpr0
695 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
696 ; GFX6-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 65535, implicit $exec
697 ; GFX6-NEXT: [[V_ADD_CO_U32_e64_:%[0-9]+]]:vgpr_32, dead [[V_ADD_CO_U32_e64_1:%[0-9]+]]:sreg_64_xexec = V_ADD_CO_U32_e64 [[COPY]], [[V_MOV_B32_e32_]], 0, implicit $exec
698 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
699 ; GFX6-NEXT: [[DS_READ_U8_:%[0-9]+]]:vgpr_32 = DS_READ_U8 [[V_ADD_CO_U32_e64_]], 0, 0, implicit $m0, implicit $exec :: (load (s8), addrspace 3)
700 ; GFX6-NEXT: $vgpr0 = COPY [[DS_READ_U8_]]
701 ; GFX7-LABEL: name: load_local_s32_from_1_gep_65535
702 ; GFX7: liveins: $vgpr0
704 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
705 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
706 ; GFX7-NEXT: [[DS_READ_U8_:%[0-9]+]]:vgpr_32 = DS_READ_U8 [[COPY]], 65535, 0, implicit $m0, implicit $exec :: (load (s8), addrspace 3)
707 ; GFX7-NEXT: $vgpr0 = COPY [[DS_READ_U8_]]
708 ; GFX9-LABEL: name: load_local_s32_from_1_gep_65535
709 ; GFX9: liveins: $vgpr0
711 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
712 ; GFX9-NEXT: [[DS_READ_U8_gfx9_:%[0-9]+]]:vgpr_32 = DS_READ_U8_gfx9 [[COPY]], 65535, 0, implicit $exec :: (load (s8), addrspace 3)
713 ; GFX9-NEXT: $vgpr0 = COPY [[DS_READ_U8_gfx9_]]
714 ; GFX10-LABEL: name: load_local_s32_from_1_gep_65535
715 ; GFX10: liveins: $vgpr0
717 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
718 ; GFX10-NEXT: [[DS_READ_U8_gfx9_:%[0-9]+]]:vgpr_32 = DS_READ_U8_gfx9 [[COPY]], 65535, 0, implicit $exec :: (load (s8), addrspace 3)
719 ; GFX10-NEXT: $vgpr0 = COPY [[DS_READ_U8_gfx9_]]
720 %0:vgpr(p3) = COPY $vgpr0
721 %1:vgpr(s32) = G_CONSTANT i32 65535
722 %2:vgpr(p3) = G_PTR_ADD %0, %1
723 %3:vgpr(s32) = G_LOAD %2 :: (load (s8), align 1, addrspace 3)
730 name: load_local_s32_from_1_gep_65535_known_bits_base_address
732 regBankSelected: true
733 tracksRegLiveness: true
739 ; GFX6-LABEL: name: load_local_s32_from_1_gep_65535_known_bits_base_address
740 ; GFX6: liveins: $vgpr0
742 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
743 ; GFX6-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 2147483647, implicit $exec
744 ; GFX6-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[COPY]], [[V_MOV_B32_e32_]], implicit $exec
745 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
746 ; GFX6-NEXT: [[DS_READ_U8_:%[0-9]+]]:vgpr_32 = DS_READ_U8 [[V_AND_B32_e64_]], 65535, 0, implicit $m0, implicit $exec :: (load (s8), addrspace 3)
747 ; GFX6-NEXT: $vgpr0 = COPY [[DS_READ_U8_]]
748 ; GFX7-LABEL: name: load_local_s32_from_1_gep_65535_known_bits_base_address
749 ; GFX7: liveins: $vgpr0
751 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
752 ; GFX7-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 2147483647, implicit $exec
753 ; GFX7-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[COPY]], [[V_MOV_B32_e32_]], implicit $exec
754 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
755 ; GFX7-NEXT: [[DS_READ_U8_:%[0-9]+]]:vgpr_32 = DS_READ_U8 [[V_AND_B32_e64_]], 65535, 0, implicit $m0, implicit $exec :: (load (s8), addrspace 3)
756 ; GFX7-NEXT: $vgpr0 = COPY [[DS_READ_U8_]]
757 ; GFX9-LABEL: name: load_local_s32_from_1_gep_65535_known_bits_base_address
758 ; GFX9: liveins: $vgpr0
760 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
761 ; GFX9-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 2147483647, implicit $exec
762 ; GFX9-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[COPY]], [[V_MOV_B32_e32_]], implicit $exec
763 ; GFX9-NEXT: [[DS_READ_U8_gfx9_:%[0-9]+]]:vgpr_32 = DS_READ_U8_gfx9 [[V_AND_B32_e64_]], 65535, 0, implicit $exec :: (load (s8), addrspace 3)
764 ; GFX9-NEXT: $vgpr0 = COPY [[DS_READ_U8_gfx9_]]
765 ; GFX10-LABEL: name: load_local_s32_from_1_gep_65535_known_bits_base_address
766 ; GFX10: liveins: $vgpr0
768 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
769 ; GFX10-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 2147483647, implicit $exec
770 ; GFX10-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[COPY]], [[V_MOV_B32_e32_]], implicit $exec
771 ; GFX10-NEXT: [[DS_READ_U8_gfx9_:%[0-9]+]]:vgpr_32 = DS_READ_U8_gfx9 [[V_AND_B32_e64_]], 65535, 0, implicit $exec :: (load (s8), addrspace 3)
772 ; GFX10-NEXT: $vgpr0 = COPY [[DS_READ_U8_gfx9_]]
773 %0:vgpr(s32) = COPY $vgpr0
774 %1:vgpr(s32) = G_CONSTANT i32 2147483647
775 %2:vgpr(s32) = G_AND %0, %1
776 %3:vgpr(p3) = G_INTTOPTR %2
777 %4:vgpr(s32) = G_CONSTANT i32 65535
778 %5:vgpr(p3) = G_PTR_ADD %3, %4
779 %6:vgpr(s32) = G_LOAD %5 :: (load (s8), align 1, addrspace 3)
786 name: load_local_s32_from_1_gep_65536
788 regBankSelected: true
789 tracksRegLiveness: true
795 ; GFX6-LABEL: name: load_local_s32_from_1_gep_65536
796 ; GFX6: liveins: $vgpr0
798 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
799 ; GFX6-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 65536, implicit $exec
800 ; GFX6-NEXT: [[V_ADD_CO_U32_e64_:%[0-9]+]]:vgpr_32, dead [[V_ADD_CO_U32_e64_1:%[0-9]+]]:sreg_64_xexec = V_ADD_CO_U32_e64 [[COPY]], [[V_MOV_B32_e32_]], 0, implicit $exec
801 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
802 ; GFX6-NEXT: [[DS_READ_U8_:%[0-9]+]]:vgpr_32 = DS_READ_U8 [[V_ADD_CO_U32_e64_]], 0, 0, implicit $m0, implicit $exec :: (load (s8), addrspace 3)
803 ; GFX6-NEXT: $vgpr0 = COPY [[DS_READ_U8_]]
804 ; GFX7-LABEL: name: load_local_s32_from_1_gep_65536
805 ; GFX7: liveins: $vgpr0
807 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
808 ; GFX7-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 65536, implicit $exec
809 ; GFX7-NEXT: [[V_ADD_CO_U32_e64_:%[0-9]+]]:vgpr_32, dead [[V_ADD_CO_U32_e64_1:%[0-9]+]]:sreg_64_xexec = V_ADD_CO_U32_e64 [[COPY]], [[V_MOV_B32_e32_]], 0, implicit $exec
810 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
811 ; GFX7-NEXT: [[DS_READ_U8_:%[0-9]+]]:vgpr_32 = DS_READ_U8 [[V_ADD_CO_U32_e64_]], 0, 0, implicit $m0, implicit $exec :: (load (s8), addrspace 3)
812 ; GFX7-NEXT: $vgpr0 = COPY [[DS_READ_U8_]]
813 ; GFX9-LABEL: name: load_local_s32_from_1_gep_65536
814 ; GFX9: liveins: $vgpr0
816 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
817 ; GFX9-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 65536, implicit $exec
818 ; GFX9-NEXT: [[V_ADD_U32_e64_:%[0-9]+]]:vgpr_32 = V_ADD_U32_e64 [[COPY]], [[V_MOV_B32_e32_]], 0, implicit $exec
819 ; GFX9-NEXT: [[DS_READ_U8_gfx9_:%[0-9]+]]:vgpr_32 = DS_READ_U8_gfx9 [[V_ADD_U32_e64_]], 0, 0, implicit $exec :: (load (s8), addrspace 3)
820 ; GFX9-NEXT: $vgpr0 = COPY [[DS_READ_U8_gfx9_]]
821 ; GFX10-LABEL: name: load_local_s32_from_1_gep_65536
822 ; GFX10: liveins: $vgpr0
824 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
825 ; GFX10-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 65536, implicit $exec
826 ; GFX10-NEXT: [[V_ADD_U32_e64_:%[0-9]+]]:vgpr_32 = V_ADD_U32_e64 [[COPY]], [[V_MOV_B32_e32_]], 0, implicit $exec
827 ; GFX10-NEXT: [[DS_READ_U8_gfx9_:%[0-9]+]]:vgpr_32 = DS_READ_U8_gfx9 [[V_ADD_U32_e64_]], 0, 0, implicit $exec :: (load (s8), addrspace 3)
828 ; GFX10-NEXT: $vgpr0 = COPY [[DS_READ_U8_gfx9_]]
829 %0:vgpr(p3) = COPY $vgpr0
830 %1:vgpr(s32) = G_CONSTANT i32 65536
831 %2:vgpr(p3) = G_PTR_ADD %0, %1
832 %3:vgpr(s32) = G_LOAD %2 :: (load (s8), align 1, addrspace 3)
839 name: load_local_s32_from_1_gep_m1
841 regBankSelected: true
842 tracksRegLiveness: true
848 ; GFX6-LABEL: name: load_local_s32_from_1_gep_m1
849 ; GFX6: liveins: $vgpr0
851 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
852 ; GFX6-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 -1, implicit $exec
853 ; GFX6-NEXT: [[V_ADD_CO_U32_e64_:%[0-9]+]]:vgpr_32, dead [[V_ADD_CO_U32_e64_1:%[0-9]+]]:sreg_64_xexec = V_ADD_CO_U32_e64 [[COPY]], [[V_MOV_B32_e32_]], 0, implicit $exec
854 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
855 ; GFX6-NEXT: [[DS_READ_U8_:%[0-9]+]]:vgpr_32 = DS_READ_U8 [[V_ADD_CO_U32_e64_]], 0, 0, implicit $m0, implicit $exec :: (load (s8), addrspace 3)
856 ; GFX6-NEXT: $vgpr0 = COPY [[DS_READ_U8_]]
857 ; GFX7-LABEL: name: load_local_s32_from_1_gep_m1
858 ; GFX7: liveins: $vgpr0
860 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
861 ; GFX7-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 -1, implicit $exec
862 ; GFX7-NEXT: [[V_ADD_CO_U32_e64_:%[0-9]+]]:vgpr_32, dead [[V_ADD_CO_U32_e64_1:%[0-9]+]]:sreg_64_xexec = V_ADD_CO_U32_e64 [[COPY]], [[V_MOV_B32_e32_]], 0, implicit $exec
863 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
864 ; GFX7-NEXT: [[DS_READ_U8_:%[0-9]+]]:vgpr_32 = DS_READ_U8 [[V_ADD_CO_U32_e64_]], 0, 0, implicit $m0, implicit $exec :: (load (s8), addrspace 3)
865 ; GFX7-NEXT: $vgpr0 = COPY [[DS_READ_U8_]]
866 ; GFX9-LABEL: name: load_local_s32_from_1_gep_m1
867 ; GFX9: liveins: $vgpr0
869 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
870 ; GFX9-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 -1, implicit $exec
871 ; GFX9-NEXT: [[V_ADD_U32_e64_:%[0-9]+]]:vgpr_32 = V_ADD_U32_e64 [[COPY]], [[V_MOV_B32_e32_]], 0, implicit $exec
872 ; GFX9-NEXT: [[DS_READ_U8_gfx9_:%[0-9]+]]:vgpr_32 = DS_READ_U8_gfx9 [[V_ADD_U32_e64_]], 0, 0, implicit $exec :: (load (s8), addrspace 3)
873 ; GFX9-NEXT: $vgpr0 = COPY [[DS_READ_U8_gfx9_]]
874 ; GFX10-LABEL: name: load_local_s32_from_1_gep_m1
875 ; GFX10: liveins: $vgpr0
877 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
878 ; GFX10-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 -1, implicit $exec
879 ; GFX10-NEXT: [[V_ADD_U32_e64_:%[0-9]+]]:vgpr_32 = V_ADD_U32_e64 [[COPY]], [[V_MOV_B32_e32_]], 0, implicit $exec
880 ; GFX10-NEXT: [[DS_READ_U8_gfx9_:%[0-9]+]]:vgpr_32 = DS_READ_U8_gfx9 [[V_ADD_U32_e64_]], 0, 0, implicit $exec :: (load (s8), addrspace 3)
881 ; GFX10-NEXT: $vgpr0 = COPY [[DS_READ_U8_gfx9_]]
882 %0:vgpr(p3) = COPY $vgpr0
883 %1:vgpr(s32) = G_CONSTANT i32 -1
884 %2:vgpr(p3) = G_PTR_ADD %0, %1
885 %3:vgpr(s32) = G_LOAD %2 :: (load (s8), align 1, addrspace 3)
892 name: load_local_s64_align4_from_1_gep_1016
894 regBankSelected: true
895 tracksRegLiveness: true
899 liveins: $vgpr0_vgpr1
901 ; GFX6-LABEL: name: load_local_s64_align4_from_1_gep_1016
902 ; GFX6: liveins: $vgpr0_vgpr1
904 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
905 ; GFX6-NEXT: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 1016
906 ; GFX6-NEXT: [[PTR_ADD:%[0-9]+]]:vgpr(p3) = G_PTR_ADD [[COPY]], [[C]](s32)
907 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
908 ; GFX6-NEXT: [[LOAD:%[0-9]+]]:vreg_64(s64) = G_LOAD [[PTR_ADD]](p3) :: (load (s64), align 4, addrspace 3)
909 ; GFX6-NEXT: $vgpr0_vgpr1 = COPY [[LOAD]](s64)
910 ; GFX7-LABEL: name: load_local_s64_align4_from_1_gep_1016
911 ; GFX7: liveins: $vgpr0_vgpr1
913 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
914 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
915 ; GFX7-NEXT: [[DS_READ2_B32_:%[0-9]+]]:vreg_64 = DS_READ2_B32 [[COPY]], 254, 255, 0, implicit $m0, implicit $exec :: (load (s64), align 4, addrspace 3)
916 ; GFX7-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ2_B32_]]
917 ; GFX9-LABEL: name: load_local_s64_align4_from_1_gep_1016
918 ; GFX9: liveins: $vgpr0_vgpr1
920 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
921 ; GFX9-NEXT: [[DS_READ2_B32_gfx9_:%[0-9]+]]:vreg_64 = DS_READ2_B32_gfx9 [[COPY]], 254, 255, 0, implicit $exec :: (load (s64), align 4, addrspace 3)
922 ; GFX9-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ2_B32_gfx9_]]
923 ; GFX10-LABEL: name: load_local_s64_align4_from_1_gep_1016
924 ; GFX10: liveins: $vgpr0_vgpr1
926 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
927 ; GFX10-NEXT: [[DS_READ2_B32_gfx9_:%[0-9]+]]:vreg_64 = DS_READ2_B32_gfx9 [[COPY]], 254, 255, 0, implicit $exec :: (load (s64), align 4, addrspace 3)
928 ; GFX10-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ2_B32_gfx9_]]
929 %0:vgpr(p3) = COPY $vgpr0
930 %1:vgpr(s32) = G_CONSTANT i32 1016
931 %2:vgpr(p3) = G_PTR_ADD %0, %1
932 %3:vgpr(s64) = G_LOAD %2 :: (load (s64), align 4, addrspace 3)
933 $vgpr0_vgpr1 = COPY %3
939 name: load_local_s64_align4_from_1_gep_1020
941 regBankSelected: true
942 tracksRegLiveness: true
946 liveins: $vgpr0_vgpr1
948 ; GFX6-LABEL: name: load_local_s64_align4_from_1_gep_1020
949 ; GFX6: liveins: $vgpr0_vgpr1
951 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
952 ; GFX6-NEXT: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 1020
953 ; GFX6-NEXT: [[PTR_ADD:%[0-9]+]]:vgpr(p3) = G_PTR_ADD [[COPY]], [[C]](s32)
954 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
955 ; GFX6-NEXT: [[LOAD:%[0-9]+]]:vreg_64(s64) = G_LOAD [[PTR_ADD]](p3) :: (load (s64), align 4, addrspace 3)
956 ; GFX6-NEXT: $vgpr0_vgpr1 = COPY [[LOAD]](s64)
957 ; GFX7-LABEL: name: load_local_s64_align4_from_1_gep_1020
958 ; GFX7: liveins: $vgpr0_vgpr1
960 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
961 ; GFX7-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1020, implicit $exec
962 ; GFX7-NEXT: [[V_ADD_CO_U32_e64_:%[0-9]+]]:vgpr_32, dead [[V_ADD_CO_U32_e64_1:%[0-9]+]]:sreg_64_xexec = V_ADD_CO_U32_e64 [[COPY]], [[V_MOV_B32_e32_]], 0, implicit $exec
963 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
964 ; GFX7-NEXT: [[DS_READ2_B32_:%[0-9]+]]:vreg_64 = DS_READ2_B32 [[V_ADD_CO_U32_e64_]], 0, 1, 0, implicit $m0, implicit $exec :: (load (s64), align 4, addrspace 3)
965 ; GFX7-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ2_B32_]]
966 ; GFX9-LABEL: name: load_local_s64_align4_from_1_gep_1020
967 ; GFX9: liveins: $vgpr0_vgpr1
969 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
970 ; GFX9-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1020, implicit $exec
971 ; GFX9-NEXT: [[V_ADD_U32_e64_:%[0-9]+]]:vgpr_32 = V_ADD_U32_e64 [[COPY]], [[V_MOV_B32_e32_]], 0, implicit $exec
972 ; GFX9-NEXT: [[DS_READ2_B32_gfx9_:%[0-9]+]]:vreg_64 = DS_READ2_B32_gfx9 [[V_ADD_U32_e64_]], 0, 1, 0, implicit $exec :: (load (s64), align 4, addrspace 3)
973 ; GFX9-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ2_B32_gfx9_]]
974 ; GFX10-LABEL: name: load_local_s64_align4_from_1_gep_1020
975 ; GFX10: liveins: $vgpr0_vgpr1
977 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
978 ; GFX10-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1020, implicit $exec
979 ; GFX10-NEXT: [[V_ADD_U32_e64_:%[0-9]+]]:vgpr_32 = V_ADD_U32_e64 [[COPY]], [[V_MOV_B32_e32_]], 0, implicit $exec
980 ; GFX10-NEXT: [[DS_READ2_B32_gfx9_:%[0-9]+]]:vreg_64 = DS_READ2_B32_gfx9 [[V_ADD_U32_e64_]], 0, 1, 0, implicit $exec :: (load (s64), align 4, addrspace 3)
981 ; GFX10-NEXT: $vgpr0_vgpr1 = COPY [[DS_READ2_B32_gfx9_]]
982 %0:vgpr(p3) = COPY $vgpr0
983 %1:vgpr(s32) = G_CONSTANT i32 1020
984 %2:vgpr(p3) = G_PTR_ADD %0, %1
985 %3:vgpr(s64) = G_LOAD %2 :: (load (s64), align 4, addrspace 3)
986 $vgpr0_vgpr1 = COPY %3