1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -amdgpu-global-isel-new-legality -mtriple=amdgcn-amd-amdhsa -mcpu=hawaii -run-pass=amdgpu-regbankselect %s -verify-machineinstrs -o - -regbankselect-fast | FileCheck %s -check-prefixes=GCN,GFX7
3 # RUN: llc -amdgpu-global-isel-new-legality -mtriple=amdgcn-amd-amdhsa -mcpu=hawaii -run-pass=amdgpu-regbankselect %s -verify-machineinstrs -o - -regbankselect-greedy | FileCheck %s -check-prefixes=GCN,GFX7
4 # RUN: llc -amdgpu-global-isel-new-legality -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1200 -run-pass=amdgpu-regbankselect %s -verify-machineinstrs -o - | FileCheck %s -check-prefixes=GCN,GFX12
7 define amdgpu_kernel void @load_global_v8i32_non_uniform(ptr addrspace(1) %in) {
8 %tmp0 = call i32 @llvm.amdgcn.workitem.id.x() #0
9 %global.not.uniform.v8i32 = getelementptr <8 x i32>, ptr addrspace(1) %in, i32 %tmp0
10 %tmp2 = load <8 x i32>, ptr addrspace(1) %global.not.uniform.v8i32
14 define amdgpu_kernel void @load_global_v4i64_non_uniform(ptr addrspace(1) %in) {
15 %tmp0 = call i32 @llvm.amdgcn.workitem.id.x() #0
16 %global.not.uniform.v4i64 = getelementptr <4 x i64>, ptr addrspace(1) %in, i32 %tmp0
17 %tmp2 = load <4 x i64>, ptr addrspace(1) %global.not.uniform.v4i64
20 define amdgpu_kernel void @load_global_v16i32_non_uniform(ptr addrspace(1) %in) {
21 %tmp0 = call i32 @llvm.amdgcn.workitem.id.x() #0
22 %global.not.uniform.v16i32 = getelementptr <16 x i32>, ptr addrspace(1) %in, i32 %tmp0
23 %tmp2 = load <16 x i32>, ptr addrspace(1) %global.not.uniform.v16i32
26 define amdgpu_kernel void @load_global_v8i64_non_uniform(ptr addrspace(1) %in) {
27 %tmp0 = call i32 @llvm.amdgcn.workitem.id.x() #0
28 %global.not.uniform.v8i64 = getelementptr <8 x i64>, ptr addrspace(1) %in, i32 %tmp0
29 %tmp2 = load <8 x i64>, ptr addrspace(1) %global.not.uniform.v8i64
32 define amdgpu_kernel void @load_global_v8i32_uniform() {ret void}
33 define amdgpu_kernel void @load_global_v4i64_uniform() {ret void}
34 define amdgpu_kernel void @load_global_v16i32_uniform() {ret void}
35 define amdgpu_kernel void @load_global_v8i64_uniform() {ret void}
36 define amdgpu_kernel void @load_constant_v8i32_non_uniform(ptr addrspace(4) %in) {
37 %tmp0 = call i32 @llvm.amdgcn.workitem.id.x() #0
38 %constant.not.uniform.v8i32 = getelementptr <8 x i32>, ptr addrspace(4) %in, i32 %tmp0
39 %tmp2 = load <8 x i32>, ptr addrspace(4) %constant.not.uniform.v8i32
43 define amdgpu_kernel void @load_constant_i256_non_uniform(ptr addrspace(4) %in) {
44 %tmp0 = call i32 @llvm.amdgcn.workitem.id.x() #0
45 %constant.not.uniform = getelementptr i256, ptr addrspace(4) %in, i32 %tmp0
46 %tmp2 = load i256, ptr addrspace(4) %constant.not.uniform
50 define amdgpu_kernel void @load_constant_v16i16_non_uniform(ptr addrspace(4) %in) {
51 %tmp0 = call i32 @llvm.amdgcn.workitem.id.x() #0
52 %constant.not.uniform = getelementptr <16 x i16>, ptr addrspace(4) %in, i32 %tmp0
53 %tmp2 = load <16 x i16>, ptr addrspace(4) %constant.not.uniform
57 define amdgpu_kernel void @load_constant_v4i64_non_uniform(ptr addrspace(4) %in) {
58 %tmp0 = call i32 @llvm.amdgcn.workitem.id.x() #0
59 %constant.not.uniform.v4i64 = getelementptr <4 x i64>, ptr addrspace(4) %in, i32 %tmp0
60 %tmp2 = load <4 x i64>, ptr addrspace(4) %constant.not.uniform.v4i64
63 define amdgpu_kernel void @load_constant_v16i32_non_uniform(ptr addrspace(4) %in) {
64 %tmp0 = call i32 @llvm.amdgcn.workitem.id.x() #0
65 %constant.not.uniform.v16i32 = getelementptr <16 x i32>, ptr addrspace(4) %in, i32 %tmp0
66 %tmp2 = load <16 x i32>, ptr addrspace(4) %constant.not.uniform.v16i32
69 define amdgpu_kernel void @load_constant_v8i64_non_uniform(ptr addrspace(4) %in) {
70 %tmp0 = call i32 @llvm.amdgcn.workitem.id.x() #0
71 %constant.not.uniform.v8i64 = getelementptr <8 x i64>, ptr addrspace(4) %in, i32 %tmp0
72 %tmp2 = load <8 x i64>, ptr addrspace(4) %constant.not.uniform.v8i64
76 define amdgpu_kernel void @load_constant_v8i32_uniform() {ret void}
77 define amdgpu_kernel void @load_constant_v16i16_uniform() {ret void}
78 define amdgpu_kernel void @load_constant_v4i64_uniform() {ret void}
79 define amdgpu_kernel void @load_constant_v16i32_uniform() {ret void}
80 define amdgpu_kernel void @load_constant_v8i64_uniform() {ret void}
81 define amdgpu_kernel void @load_local_uniform() { ret void }
82 define amdgpu_kernel void @load_region_uniform() { ret void }
83 define amdgpu_kernel void @extload_constant_i8_to_i32_uniform() { ret void }
84 define amdgpu_kernel void @extload_global_i8_to_i32_uniform() { ret void }
85 define amdgpu_kernel void @extload_constant_i16_to_i32_uniform() { ret void }
86 define amdgpu_kernel void @extload_global_i16_to_i32_uniform() { ret void }
87 define amdgpu_kernel void @load_constant_i32_uniform_align4() {ret void}
88 define amdgpu_kernel void @load_constant_i32_uniform_align2() {ret void}
89 define amdgpu_kernel void @load_constant_i32_uniform_align1() {ret void}
90 define amdgpu_kernel void @load_private_uniform_sgpr_i32() {ret void}
91 define amdgpu_kernel void @load_constant_v8i32_vgpr_crash() { ret void }
92 define amdgpu_kernel void @load_constant_v8i32_vgpr_crash_loop_phi() { ret void }
94 define amdgpu_kernel void @load_constant_v3i32_align4() { ret void }
95 define amdgpu_kernel void @load_constant_v3i32_align8() { ret void }
96 define amdgpu_kernel void @load_constant_v3i32_align16() { ret void }
98 define amdgpu_kernel void @load_constant_v6i16_align4() { ret void }
99 define amdgpu_kernel void @load_constant_v6i16_align8() { ret void }
100 define amdgpu_kernel void @load_constant_v6i16_align16() { ret void }
102 define amdgpu_kernel void @load_constant_i96_align4() { ret void }
103 define amdgpu_kernel void @load_constant_i96_align8() { ret void }
104 define amdgpu_kernel void @load_constant_i96_align16() { ret void }
106 declare i32 @llvm.amdgcn.workitem.id.x() #0
107 attributes #0 = { nounwind readnone }
111 name: load_global_v8i32_non_uniform
116 liveins: $sgpr0_sgpr1
117 ; GCN-LABEL: name: load_global_v8i32_non_uniform
118 ; GCN: liveins: $sgpr0_sgpr1
120 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
121 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
122 ; GCN-NEXT: [[LOAD:%[0-9]+]]:vgpr(<4 x s32>) = G_LOAD [[COPY]](p1) :: (load (<4 x s32>) from %ir.global.not.uniform.v8i32, align 32, addrspace 1)
123 ; GCN-NEXT: [[C:%[0-9]+]]:vgpr(s64) = G_CONSTANT i64 16
124 ; GCN-NEXT: [[PTR_ADD:%[0-9]+]]:vgpr(p1) = G_PTR_ADD [[COPY]], [[C]](s64)
125 ; GCN-NEXT: [[LOAD1:%[0-9]+]]:vgpr(<4 x s32>) = G_LOAD [[PTR_ADD]](p1) :: (load (<4 x s32>) from %ir.global.not.uniform.v8i32 + 16, basealign 32, addrspace 1)
126 ; GCN-NEXT: [[CONCAT_VECTORS:%[0-9]+]]:vgpr(<8 x s32>) = G_CONCAT_VECTORS [[LOAD]](<4 x s32>), [[LOAD1]](<4 x s32>)
127 %0:_(p1) = COPY $sgpr0_sgpr1
128 %1:_(<8 x s32>) = G_LOAD %0 :: (load (<8 x s32>) from %ir.global.not.uniform.v8i32)
132 name: load_global_v4i64_non_uniform
137 liveins: $sgpr0_sgpr1
139 ; GCN-LABEL: name: load_global_v4i64_non_uniform
140 ; GCN: liveins: $sgpr0_sgpr1
142 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
143 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
144 ; GCN-NEXT: [[LOAD:%[0-9]+]]:vgpr(<2 x s64>) = G_LOAD [[COPY]](p1) :: (load (<2 x s64>) from %ir.global.not.uniform.v4i64, align 32, addrspace 1)
145 ; GCN-NEXT: [[C:%[0-9]+]]:vgpr(s64) = G_CONSTANT i64 16
146 ; GCN-NEXT: [[PTR_ADD:%[0-9]+]]:vgpr(p1) = G_PTR_ADD [[COPY]], [[C]](s64)
147 ; GCN-NEXT: [[LOAD1:%[0-9]+]]:vgpr(<2 x s64>) = G_LOAD [[PTR_ADD]](p1) :: (load (<2 x s64>) from %ir.global.not.uniform.v4i64 + 16, basealign 32, addrspace 1)
148 ; GCN-NEXT: [[CONCAT_VECTORS:%[0-9]+]]:vgpr(<4 x s64>) = G_CONCAT_VECTORS [[LOAD]](<2 x s64>), [[LOAD1]](<2 x s64>)
149 %0:_(p1) = COPY $sgpr0_sgpr1
150 %1:_(<4 x s64>) = G_LOAD %0 :: (load (<4 x s64>) from %ir.global.not.uniform.v4i64)
154 name: load_global_v16i32_non_uniform
159 liveins: $sgpr0_sgpr1
160 ; GCN-LABEL: name: load_global_v16i32_non_uniform
161 ; GCN: liveins: $sgpr0_sgpr1
163 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
164 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
165 ; GCN-NEXT: [[LOAD:%[0-9]+]]:vgpr(<4 x s32>) = G_LOAD [[COPY]](p1) :: (load (<4 x s32>) from %ir.global.not.uniform.v16i32, align 64, addrspace 1)
166 ; GCN-NEXT: [[C:%[0-9]+]]:vgpr(s64) = G_CONSTANT i64 16
167 ; GCN-NEXT: [[PTR_ADD:%[0-9]+]]:vgpr(p1) = G_PTR_ADD [[COPY]], [[C]](s64)
168 ; GCN-NEXT: [[LOAD1:%[0-9]+]]:vgpr(<4 x s32>) = G_LOAD [[PTR_ADD]](p1) :: (load (<4 x s32>) from %ir.global.not.uniform.v16i32 + 16, basealign 64, addrspace 1)
169 ; GCN-NEXT: [[C1:%[0-9]+]]:vgpr(s64) = G_CONSTANT i64 32
170 ; GCN-NEXT: [[PTR_ADD1:%[0-9]+]]:vgpr(p1) = G_PTR_ADD [[COPY]], [[C1]](s64)
171 ; GCN-NEXT: [[LOAD2:%[0-9]+]]:vgpr(<4 x s32>) = G_LOAD [[PTR_ADD1]](p1) :: (load (<4 x s32>) from %ir.global.not.uniform.v16i32 + 32, align 32, basealign 64, addrspace 1)
172 ; GCN-NEXT: [[C2:%[0-9]+]]:vgpr(s64) = G_CONSTANT i64 48
173 ; GCN-NEXT: [[PTR_ADD2:%[0-9]+]]:vgpr(p1) = G_PTR_ADD [[COPY]], [[C2]](s64)
174 ; GCN-NEXT: [[LOAD3:%[0-9]+]]:vgpr(<4 x s32>) = G_LOAD [[PTR_ADD2]](p1) :: (load (<4 x s32>) from %ir.global.not.uniform.v16i32 + 48, basealign 64, addrspace 1)
175 ; GCN-NEXT: [[CONCAT_VECTORS:%[0-9]+]]:vgpr(<16 x s32>) = G_CONCAT_VECTORS [[LOAD]](<4 x s32>), [[LOAD1]](<4 x s32>), [[LOAD2]](<4 x s32>), [[LOAD3]](<4 x s32>)
176 %0:_(p1) = COPY $sgpr0_sgpr1
177 %1:_(<16 x s32>) = G_LOAD %0 :: (load (<16 x s32>) from %ir.global.not.uniform.v16i32)
181 name: load_global_v8i64_non_uniform
186 liveins: $sgpr0_sgpr1
187 ; GCN-LABEL: name: load_global_v8i64_non_uniform
188 ; GCN: liveins: $sgpr0_sgpr1
190 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
191 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
192 ; GCN-NEXT: [[LOAD:%[0-9]+]]:vgpr(<2 x s64>) = G_LOAD [[COPY]](p1) :: (load (<2 x s64>) from %ir.global.not.uniform.v8i64, align 64, addrspace 1)
193 ; GCN-NEXT: [[C:%[0-9]+]]:vgpr(s64) = G_CONSTANT i64 16
194 ; GCN-NEXT: [[PTR_ADD:%[0-9]+]]:vgpr(p1) = G_PTR_ADD [[COPY]], [[C]](s64)
195 ; GCN-NEXT: [[LOAD1:%[0-9]+]]:vgpr(<2 x s64>) = G_LOAD [[PTR_ADD]](p1) :: (load (<2 x s64>) from %ir.global.not.uniform.v8i64 + 16, basealign 64, addrspace 1)
196 ; GCN-NEXT: [[C1:%[0-9]+]]:vgpr(s64) = G_CONSTANT i64 32
197 ; GCN-NEXT: [[PTR_ADD1:%[0-9]+]]:vgpr(p1) = G_PTR_ADD [[COPY]], [[C1]](s64)
198 ; GCN-NEXT: [[LOAD2:%[0-9]+]]:vgpr(<2 x s64>) = G_LOAD [[PTR_ADD1]](p1) :: (load (<2 x s64>) from %ir.global.not.uniform.v8i64 + 32, align 32, basealign 64, addrspace 1)
199 ; GCN-NEXT: [[C2:%[0-9]+]]:vgpr(s64) = G_CONSTANT i64 48
200 ; GCN-NEXT: [[PTR_ADD2:%[0-9]+]]:vgpr(p1) = G_PTR_ADD [[COPY]], [[C2]](s64)
201 ; GCN-NEXT: [[LOAD3:%[0-9]+]]:vgpr(<2 x s64>) = G_LOAD [[PTR_ADD2]](p1) :: (load (<2 x s64>) from %ir.global.not.uniform.v8i64 + 48, basealign 64, addrspace 1)
202 ; GCN-NEXT: [[CONCAT_VECTORS:%[0-9]+]]:vgpr(<8 x s64>) = G_CONCAT_VECTORS [[LOAD]](<2 x s64>), [[LOAD1]](<2 x s64>), [[LOAD2]](<2 x s64>), [[LOAD3]](<2 x s64>)
203 %0:_(p1) = COPY $sgpr0_sgpr1
204 %1:_(<8 x s64>) = G_LOAD %0 :: (load (<8 x s64>) from %ir.global.not.uniform.v8i64)
208 name: load_global_v8i32_uniform
213 liveins: $sgpr0_sgpr1
214 ; GCN-LABEL: name: load_global_v8i32_uniform
215 ; GCN: liveins: $sgpr0_sgpr1
217 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
218 ; GCN-NEXT: [[LOAD:%[0-9]+]]:sgpr(<8 x s32>) = G_LOAD [[COPY]](p1) :: (invariant load (<8 x s32>), addrspace 1)
219 %0:_(p1) = COPY $sgpr0_sgpr1
220 %1:_(<8 x s32>) = G_LOAD %0 :: (invariant load (<8 x s32>), addrspace 1)
224 name: load_global_v4i64_uniform
229 liveins: $sgpr0_sgpr1
230 ; GCN-LABEL: name: load_global_v4i64_uniform
231 ; GCN: liveins: $sgpr0_sgpr1
233 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
234 ; GCN-NEXT: [[LOAD:%[0-9]+]]:sgpr(<4 x s64>) = G_LOAD [[COPY]](p1) :: (invariant load (<4 x s64>), addrspace 1)
235 %0:_(p1) = COPY $sgpr0_sgpr1
236 %1:_(<4 x s64>) = G_LOAD %0 :: (invariant load (<4 x s64>), addrspace 1)
240 name: load_global_v16i32_uniform
245 liveins: $sgpr0_sgpr1
246 ; GCN-LABEL: name: load_global_v16i32_uniform
247 ; GCN: liveins: $sgpr0_sgpr1
249 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
250 ; GCN-NEXT: [[LOAD:%[0-9]+]]:sgpr(<16 x s32>) = G_LOAD [[COPY]](p1) :: (invariant load (<16 x s32>), addrspace 1)
251 %0:_(p1) = COPY $sgpr0_sgpr1
252 %1:_(<16 x s32>) = G_LOAD %0 :: (invariant load (<16 x s32>), addrspace 1)
256 name: load_global_v8i64_uniform
261 liveins: $sgpr0_sgpr1
262 ; GCN-LABEL: name: load_global_v8i64_uniform
263 ; GCN: liveins: $sgpr0_sgpr1
265 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
266 ; GCN-NEXT: [[LOAD:%[0-9]+]]:sgpr(<8 x s64>) = G_LOAD [[COPY]](p1) :: (invariant load (<8 x s64>), addrspace 1)
267 %0:_(p1) = COPY $sgpr0_sgpr1
268 %1:_(<8 x s64>) = G_LOAD %0 :: (invariant load (<8 x s64>), addrspace 1)
272 name: load_constant_v8i32_non_uniform
277 liveins: $sgpr0_sgpr1
278 ; GCN-LABEL: name: load_constant_v8i32_non_uniform
279 ; GCN: liveins: $sgpr0_sgpr1
281 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
282 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr(p4) = COPY [[COPY]](p4)
283 ; GCN-NEXT: [[LOAD:%[0-9]+]]:vgpr(<4 x s32>) = G_LOAD [[COPY]](p4) :: (load (<4 x s32>) from %ir.constant.not.uniform.v8i32, align 32, addrspace 4)
284 ; GCN-NEXT: [[C:%[0-9]+]]:vgpr(s64) = G_CONSTANT i64 16
285 ; GCN-NEXT: [[PTR_ADD:%[0-9]+]]:vgpr(p4) = G_PTR_ADD [[COPY]], [[C]](s64)
286 ; GCN-NEXT: [[LOAD1:%[0-9]+]]:vgpr(<4 x s32>) = G_LOAD [[PTR_ADD]](p4) :: (load (<4 x s32>) from %ir.constant.not.uniform.v8i32 + 16, basealign 32, addrspace 4)
287 ; GCN-NEXT: [[CONCAT_VECTORS:%[0-9]+]]:vgpr(<8 x s32>) = G_CONCAT_VECTORS [[LOAD]](<4 x s32>), [[LOAD1]](<4 x s32>)
288 %0:_(p4) = COPY $sgpr0_sgpr1
289 %1:_(<8 x s32>) = G_LOAD %0 :: (load (<8 x s32>) from %ir.constant.not.uniform.v8i32)
293 name: load_constant_i256_non_uniform
298 liveins: $sgpr0_sgpr1
299 ; GCN-LABEL: name: load_constant_i256_non_uniform
300 ; GCN: liveins: $sgpr0_sgpr1
302 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
303 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr(p4) = COPY [[COPY]](p4)
304 ; GCN-NEXT: [[LOAD:%[0-9]+]]:vgpr(s128) = G_LOAD [[COPY]](p4) :: (load (s128) from %ir.constant.not.uniform, align 32, addrspace 4)
305 ; GCN-NEXT: [[C:%[0-9]+]]:vgpr(s64) = G_CONSTANT i64 16
306 ; GCN-NEXT: [[PTR_ADD:%[0-9]+]]:vgpr(p4) = G_PTR_ADD [[COPY]], [[C]](s64)
307 ; GCN-NEXT: [[LOAD1:%[0-9]+]]:vgpr(s128) = G_LOAD [[PTR_ADD]](p4) :: (load (s128) from %ir.constant.not.uniform + 16, basealign 32, addrspace 4)
308 ; GCN-NEXT: [[MV:%[0-9]+]]:vgpr(s256) = G_MERGE_VALUES [[LOAD]](s128), [[LOAD1]](s128)
309 %0:_(p4) = COPY $sgpr0_sgpr1
310 %1:_(s256) = G_LOAD %0 :: (load (s256) from %ir.constant.not.uniform)
314 name: load_constant_v16i16_non_uniform
319 liveins: $sgpr0_sgpr1
321 ; GCN-LABEL: name: load_constant_v16i16_non_uniform
322 ; GCN: liveins: $sgpr0_sgpr1
324 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
325 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr(p4) = COPY [[COPY]](p4)
326 ; GCN-NEXT: [[LOAD:%[0-9]+]]:vgpr(<8 x s16>) = G_LOAD [[COPY]](p4) :: (load (<8 x s16>) from %ir.constant.not.uniform, align 32, addrspace 4)
327 ; GCN-NEXT: [[C:%[0-9]+]]:vgpr(s64) = G_CONSTANT i64 16
328 ; GCN-NEXT: [[PTR_ADD:%[0-9]+]]:vgpr(p4) = G_PTR_ADD [[COPY]], [[C]](s64)
329 ; GCN-NEXT: [[LOAD1:%[0-9]+]]:vgpr(<8 x s16>) = G_LOAD [[PTR_ADD]](p4) :: (load (<8 x s16>) from %ir.constant.not.uniform + 16, basealign 32, addrspace 4)
330 ; GCN-NEXT: [[CONCAT_VECTORS:%[0-9]+]]:vgpr(<16 x s16>) = G_CONCAT_VECTORS [[LOAD]](<8 x s16>), [[LOAD1]](<8 x s16>)
331 %0:_(p4) = COPY $sgpr0_sgpr1
332 %1:_(<16 x s16>) = G_LOAD %0 :: (load (<16 x s16>) from %ir.constant.not.uniform)
336 name: load_constant_v4i64_non_uniform
341 liveins: $sgpr0_sgpr1
342 ; GCN-LABEL: name: load_constant_v4i64_non_uniform
343 ; GCN: liveins: $sgpr0_sgpr1
345 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
346 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr(p4) = COPY [[COPY]](p4)
347 ; GCN-NEXT: [[LOAD:%[0-9]+]]:vgpr(<2 x s64>) = G_LOAD [[COPY]](p4) :: (load (<2 x s64>) from %ir.constant.not.uniform.v4i64, align 32, addrspace 4)
348 ; GCN-NEXT: [[C:%[0-9]+]]:vgpr(s64) = G_CONSTANT i64 16
349 ; GCN-NEXT: [[PTR_ADD:%[0-9]+]]:vgpr(p4) = G_PTR_ADD [[COPY]], [[C]](s64)
350 ; GCN-NEXT: [[LOAD1:%[0-9]+]]:vgpr(<2 x s64>) = G_LOAD [[PTR_ADD]](p4) :: (load (<2 x s64>) from %ir.constant.not.uniform.v4i64 + 16, basealign 32, addrspace 4)
351 ; GCN-NEXT: [[CONCAT_VECTORS:%[0-9]+]]:vgpr(<4 x s64>) = G_CONCAT_VECTORS [[LOAD]](<2 x s64>), [[LOAD1]](<2 x s64>)
352 %0:_(p4) = COPY $sgpr0_sgpr1
353 %1:_(<4 x s64>) = G_LOAD %0 :: (load (<4 x s64>) from %ir.constant.not.uniform.v4i64)
357 name: load_constant_v16i32_non_uniform
362 liveins: $sgpr0_sgpr1
363 ; GCN-LABEL: name: load_constant_v16i32_non_uniform
364 ; GCN: liveins: $sgpr0_sgpr1
366 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
367 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr(p4) = COPY [[COPY]](p4)
368 ; GCN-NEXT: [[LOAD:%[0-9]+]]:vgpr(<4 x s32>) = G_LOAD [[COPY]](p4) :: (load (<4 x s32>) from %ir.constant.not.uniform.v16i32, align 64, addrspace 4)
369 ; GCN-NEXT: [[C:%[0-9]+]]:vgpr(s64) = G_CONSTANT i64 16
370 ; GCN-NEXT: [[PTR_ADD:%[0-9]+]]:vgpr(p4) = G_PTR_ADD [[COPY]], [[C]](s64)
371 ; GCN-NEXT: [[LOAD1:%[0-9]+]]:vgpr(<4 x s32>) = G_LOAD [[PTR_ADD]](p4) :: (load (<4 x s32>) from %ir.constant.not.uniform.v16i32 + 16, basealign 64, addrspace 4)
372 ; GCN-NEXT: [[C1:%[0-9]+]]:vgpr(s64) = G_CONSTANT i64 32
373 ; GCN-NEXT: [[PTR_ADD1:%[0-9]+]]:vgpr(p4) = G_PTR_ADD [[COPY]], [[C1]](s64)
374 ; GCN-NEXT: [[LOAD2:%[0-9]+]]:vgpr(<4 x s32>) = G_LOAD [[PTR_ADD1]](p4) :: (load (<4 x s32>) from %ir.constant.not.uniform.v16i32 + 32, align 32, basealign 64, addrspace 4)
375 ; GCN-NEXT: [[C2:%[0-9]+]]:vgpr(s64) = G_CONSTANT i64 48
376 ; GCN-NEXT: [[PTR_ADD2:%[0-9]+]]:vgpr(p4) = G_PTR_ADD [[COPY]], [[C2]](s64)
377 ; GCN-NEXT: [[LOAD3:%[0-9]+]]:vgpr(<4 x s32>) = G_LOAD [[PTR_ADD2]](p4) :: (load (<4 x s32>) from %ir.constant.not.uniform.v16i32 + 48, basealign 64, addrspace 4)
378 ; GCN-NEXT: [[CONCAT_VECTORS:%[0-9]+]]:vgpr(<16 x s32>) = G_CONCAT_VECTORS [[LOAD]](<4 x s32>), [[LOAD1]](<4 x s32>), [[LOAD2]](<4 x s32>), [[LOAD3]](<4 x s32>)
379 %0:_(p4) = COPY $sgpr0_sgpr1
380 %1:_(<16 x s32>) = G_LOAD %0 :: (load (<16 x s32>) from %ir.constant.not.uniform.v16i32)
384 name: load_constant_v8i64_non_uniform
389 liveins: $sgpr0_sgpr1
390 ; GCN-LABEL: name: load_constant_v8i64_non_uniform
391 ; GCN: liveins: $sgpr0_sgpr1
393 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
394 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr(p4) = COPY [[COPY]](p4)
395 ; GCN-NEXT: [[LOAD:%[0-9]+]]:vgpr(<2 x s64>) = G_LOAD [[COPY]](p4) :: (load (<2 x s64>) from %ir.constant.not.uniform.v8i64, align 64, addrspace 4)
396 ; GCN-NEXT: [[C:%[0-9]+]]:vgpr(s64) = G_CONSTANT i64 16
397 ; GCN-NEXT: [[PTR_ADD:%[0-9]+]]:vgpr(p4) = G_PTR_ADD [[COPY]], [[C]](s64)
398 ; GCN-NEXT: [[LOAD1:%[0-9]+]]:vgpr(<2 x s64>) = G_LOAD [[PTR_ADD]](p4) :: (load (<2 x s64>) from %ir.constant.not.uniform.v8i64 + 16, basealign 64, addrspace 4)
399 ; GCN-NEXT: [[C1:%[0-9]+]]:vgpr(s64) = G_CONSTANT i64 32
400 ; GCN-NEXT: [[PTR_ADD1:%[0-9]+]]:vgpr(p4) = G_PTR_ADD [[COPY]], [[C1]](s64)
401 ; GCN-NEXT: [[LOAD2:%[0-9]+]]:vgpr(<2 x s64>) = G_LOAD [[PTR_ADD1]](p4) :: (load (<2 x s64>) from %ir.constant.not.uniform.v8i64 + 32, align 32, basealign 64, addrspace 4)
402 ; GCN-NEXT: [[C2:%[0-9]+]]:vgpr(s64) = G_CONSTANT i64 48
403 ; GCN-NEXT: [[PTR_ADD2:%[0-9]+]]:vgpr(p4) = G_PTR_ADD [[COPY]], [[C2]](s64)
404 ; GCN-NEXT: [[LOAD3:%[0-9]+]]:vgpr(<2 x s64>) = G_LOAD [[PTR_ADD2]](p4) :: (load (<2 x s64>) from %ir.constant.not.uniform.v8i64 + 48, basealign 64, addrspace 4)
405 ; GCN-NEXT: [[CONCAT_VECTORS:%[0-9]+]]:vgpr(<8 x s64>) = G_CONCAT_VECTORS [[LOAD]](<2 x s64>), [[LOAD1]](<2 x s64>), [[LOAD2]](<2 x s64>), [[LOAD3]](<2 x s64>)
406 %0:_(p4) = COPY $sgpr0_sgpr1
407 %1:_(<8 x s64>) = G_LOAD %0 :: (load (<8 x s64>) from %ir.constant.not.uniform.v8i64)
411 name: load_constant_v8i32_uniform
416 liveins: $sgpr0_sgpr1
417 ; GCN-LABEL: name: load_constant_v8i32_uniform
418 ; GCN: liveins: $sgpr0_sgpr1
420 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
421 ; GCN-NEXT: [[LOAD:%[0-9]+]]:sgpr(<8 x s32>) = G_LOAD [[COPY]](p4) :: (load (<8 x s32>), addrspace 4)
422 %0:_(p4) = COPY $sgpr0_sgpr1
423 %1:_(<8 x s32>) = G_LOAD %0 :: (load (<8 x s32>), addrspace 4)
427 name: load_constant_v16i16_uniform
432 liveins: $sgpr0_sgpr1
433 ; GCN-LABEL: name: load_constant_v16i16_uniform
434 ; GCN: liveins: $sgpr0_sgpr1
436 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
437 ; GCN-NEXT: [[LOAD:%[0-9]+]]:sgpr(<16 x s16>) = G_LOAD [[COPY]](p4) :: (load (<16 x s16>), addrspace 4)
438 %0:_(p4) = COPY $sgpr0_sgpr1
439 %1:_(<16 x s16>) = G_LOAD %0 :: (load (<16 x s16>), addrspace 4)
443 name: load_constant_v4i64_uniform
448 liveins: $sgpr0_sgpr1
449 ; GCN-LABEL: name: load_constant_v4i64_uniform
450 ; GCN: liveins: $sgpr0_sgpr1
452 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
453 ; GCN-NEXT: [[LOAD:%[0-9]+]]:sgpr(<4 x s64>) = G_LOAD [[COPY]](p4) :: (load (<4 x s64>), addrspace 4)
454 %0:_(p4) = COPY $sgpr0_sgpr1
455 %1:_(<4 x s64>) = G_LOAD %0 :: (load (<4 x s64>), addrspace 4)
459 name: load_constant_v16i32_uniform
464 liveins: $sgpr0_sgpr1
465 ; GCN-LABEL: name: load_constant_v16i32_uniform
466 ; GCN: liveins: $sgpr0_sgpr1
468 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
469 ; GCN-NEXT: [[LOAD:%[0-9]+]]:sgpr(<16 x s32>) = G_LOAD [[COPY]](p4) :: (load (<16 x s32>), addrspace 4)
470 %0:_(p4) = COPY $sgpr0_sgpr1
471 %1:_(<16 x s32>) = G_LOAD %0 :: (load (<16 x s32>), addrspace 4)
475 name: load_constant_v8i64_uniform
480 liveins: $sgpr0_sgpr1
481 ; GCN-LABEL: name: load_constant_v8i64_uniform
482 ; GCN: liveins: $sgpr0_sgpr1
484 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
485 ; GCN-NEXT: [[LOAD:%[0-9]+]]:sgpr(<8 x s64>) = G_LOAD [[COPY]](p4) :: (load (<8 x s64>), addrspace 4)
486 %0:_(p4) = COPY $sgpr0_sgpr1
487 %1:_(<8 x s64>) = G_LOAD %0 :: (load (<8 x s64>), addrspace 4)
491 name: load_local_uniform
497 ; GCN-LABEL: name: load_local_uniform
498 ; GCN: liveins: $sgpr0
500 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p3) = COPY $sgpr0
501 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY [[COPY]](p3)
502 ; GCN-NEXT: [[LOAD:%[0-9]+]]:vgpr(s32) = G_LOAD [[COPY1]](p3) :: (load (s32), addrspace 3)
503 %0:_(p3) = COPY $sgpr0
504 %1:_(s32) = G_LOAD %0 :: (load (s32), addrspace 3)
508 name: load_region_uniform
514 ; GCN-LABEL: name: load_region_uniform
515 ; GCN: liveins: $sgpr0
517 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p3) = COPY $sgpr0
518 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY [[COPY]](p3)
519 ; GCN-NEXT: [[LOAD:%[0-9]+]]:vgpr(s32) = G_LOAD [[COPY1]](p3) :: (load (s32), addrspace 5)
520 %0:_(p3) = COPY $sgpr0
521 %1:_(s32) = G_LOAD %0 :: (load (s32), addrspace 5)
526 name: extload_constant_i8_to_i32_uniform
531 liveins: $sgpr0_sgpr1
532 ; GFX7-LABEL: name: extload_constant_i8_to_i32_uniform
533 ; GFX7: liveins: $sgpr0_sgpr1
535 ; GFX7-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
536 ; GFX7-NEXT: [[COPY1:%[0-9]+]]:vgpr(p4) = COPY [[COPY]](p4)
537 ; GFX7-NEXT: [[LOAD:%[0-9]+]]:vgpr(s32) = G_LOAD [[COPY1]](p4) :: (load (s8), addrspace 4)
539 ; GFX12-LABEL: name: extload_constant_i8_to_i32_uniform
540 ; GFX12: liveins: $sgpr0_sgpr1
542 ; GFX12-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
543 ; GFX12-NEXT: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p4) :: (load (s8), addrspace 4)
544 %0:_(p4) = COPY $sgpr0_sgpr1
545 %1:_(s32) = G_LOAD %0 :: (load (s8), addrspace 4, align 1)
549 name: extload_global_i8_to_i32_uniform
554 liveins: $sgpr0_sgpr1
556 ; GCN-LABEL: name: extload_global_i8_to_i32_uniform
557 ; GCN: liveins: $sgpr0_sgpr1
559 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
560 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr(p4) = COPY [[COPY]](p4)
561 ; GCN-NEXT: [[LOAD:%[0-9]+]]:vgpr(s32) = G_LOAD [[COPY1]](p4) :: (load (s8), addrspace 1)
562 %0:_(p4) = COPY $sgpr0_sgpr1
563 %1:_(s32) = G_LOAD %0 :: (load (s8), addrspace 1, align 1)
567 name: extload_constant_i16_to_i32_uniform
572 liveins: $sgpr0_sgpr1
574 ; GFX7-LABEL: name: extload_constant_i16_to_i32_uniform
575 ; GFX7: liveins: $sgpr0_sgpr1
577 ; GFX7-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
578 ; GFX7-NEXT: [[COPY1:%[0-9]+]]:vgpr(p4) = COPY [[COPY]](p4)
579 ; GFX7-NEXT: [[LOAD:%[0-9]+]]:vgpr(s32) = G_LOAD [[COPY1]](p4) :: (load (s16), addrspace 4)
581 ; GFX12-LABEL: name: extload_constant_i16_to_i32_uniform
582 ; GFX12: liveins: $sgpr0_sgpr1
584 ; GFX12-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
585 ; GFX12-NEXT: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p4) :: (load (s16), addrspace 4)
586 %0:_(p4) = COPY $sgpr0_sgpr1
587 %1:_(s32) = G_LOAD %0 :: (load (s16), addrspace 4, align 2)
591 name: extload_global_i16_to_i32_uniform
596 liveins: $sgpr0_sgpr1
598 ; GCN-LABEL: name: extload_global_i16_to_i32_uniform
599 ; GCN: liveins: $sgpr0_sgpr1
601 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
602 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr(p4) = COPY [[COPY]](p4)
603 ; GCN-NEXT: [[LOAD:%[0-9]+]]:vgpr(s32) = G_LOAD [[COPY1]](p4) :: (load (s16), addrspace 1)
604 %0:_(p4) = COPY $sgpr0_sgpr1
605 %1:_(s32) = G_LOAD %0 :: (load (s16), addrspace 1, align 2)
609 name: load_constant_i32_uniform_align4
614 liveins: $sgpr0_sgpr1
615 ; GCN-LABEL: name: load_constant_i32_uniform_align4
616 ; GCN: liveins: $sgpr0_sgpr1
618 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
619 ; GCN-NEXT: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p4) :: (load (s32), addrspace 4)
620 %0:_(p4) = COPY $sgpr0_sgpr1
621 %1:_(s32) = G_LOAD %0 :: (load (s32), addrspace 4, align 4)
625 name: load_constant_i32_uniform_align2
630 liveins: $sgpr0_sgpr1
632 ; GCN-LABEL: name: load_constant_i32_uniform_align2
633 ; GCN: liveins: $sgpr0_sgpr1
635 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
636 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr(p4) = COPY [[COPY]](p4)
637 ; GCN-NEXT: [[LOAD:%[0-9]+]]:vgpr(s32) = G_LOAD [[COPY1]](p4) :: (load (s32), align 2, addrspace 4)
638 %0:_(p4) = COPY $sgpr0_sgpr1
639 %1:_(s32) = G_LOAD %0 :: (load (s32), addrspace 4, align 2)
643 name: load_constant_i32_uniform_align1
648 liveins: $sgpr0_sgpr1
650 ; GCN-LABEL: name: load_constant_i32_uniform_align1
651 ; GCN: liveins: $sgpr0_sgpr1
653 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
654 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr(p4) = COPY [[COPY]](p4)
655 ; GCN-NEXT: [[LOAD:%[0-9]+]]:vgpr(s32) = G_LOAD [[COPY1]](p4) :: (load (s32), align 1, addrspace 4)
656 %0:_(p4) = COPY $sgpr0_sgpr1
657 %1:_(s32) = G_LOAD %0 :: (load (s32), addrspace 4, align 1)
661 name: load_private_uniform_sgpr_i32
668 ; GCN-LABEL: name: load_private_uniform_sgpr_i32
669 ; GCN: liveins: $sgpr0
671 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p5) = COPY $sgpr0
672 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr(p5) = COPY [[COPY]](p5)
673 ; GCN-NEXT: [[LOAD:%[0-9]+]]:vgpr(s32) = G_LOAD [[COPY1]](p5) :: (load (s32), addrspace 5)
674 %0:_(p5) = COPY $sgpr0
675 %1:_(s32) = G_LOAD %0 :: (load (s32), addrspace 5, align 4)
679 name: load_constant_v8i32_vgpr_crash
681 tracksRegLiveness: true
685 liveins: $vgpr0_vgpr1
687 ; GCN-LABEL: name: load_constant_v8i32_vgpr_crash
688 ; GCN: liveins: $vgpr0_vgpr1
690 ; GCN-NEXT: [[COPY:%[0-9]+]]:vgpr(p4) = COPY $vgpr0_vgpr1
691 ; GCN-NEXT: [[LOAD:%[0-9]+]]:vgpr(<4 x s32>) = G_LOAD [[COPY]](p4) :: (load (<4 x s32>), align 32, addrspace 4)
692 ; GCN-NEXT: [[C:%[0-9]+]]:vgpr(s64) = G_CONSTANT i64 16
693 ; GCN-NEXT: [[PTR_ADD:%[0-9]+]]:vgpr(p4) = G_PTR_ADD [[COPY]], [[C]](s64)
694 ; GCN-NEXT: [[LOAD1:%[0-9]+]]:vgpr(<4 x s32>) = G_LOAD [[PTR_ADD]](p4) :: (load (<4 x s32>) from unknown-address + 16, addrspace 4)
695 ; GCN-NEXT: [[CONCAT_VECTORS:%[0-9]+]]:vgpr(<8 x s32>) = G_CONCAT_VECTORS [[LOAD]](<4 x s32>), [[LOAD1]](<4 x s32>)
696 %0:_(p4) = COPY $vgpr0_vgpr1
697 %1:_(<8 x s32>) = G_LOAD %0 :: (load (<8 x s32>), addrspace 4)
701 name: load_constant_v8i32_vgpr_crash_loop_phi
703 tracksRegLiveness: true
706 ; GCN-LABEL: name: load_constant_v8i32_vgpr_crash_loop_phi
708 ; GCN-NEXT: successors: %bb.1(0x80000000)
709 ; GCN-NEXT: liveins: $sgpr0_sgpr1, $sgpr2_sgpr3
711 ; GCN-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
712 ; GCN-NEXT: [[COPY1:%[0-9]+]]:sgpr(p4) = COPY $sgpr2_sgpr3
713 ; GCN-NEXT: G_BR %bb.1
716 ; GCN-NEXT: successors: %bb.1(0x80000000)
718 ; GCN-NEXT: [[PHI:%[0-9]+]]:vgpr(p4) = G_PHI [[COPY]](p4), %bb.0, %3(p4), %bb.1
719 ; GCN-NEXT: [[LOAD:%[0-9]+]]:vgpr(<4 x s32>) = G_LOAD [[PHI]](p4) :: (load (<4 x s32>), align 32, addrspace 4)
720 ; GCN-NEXT: [[C:%[0-9]+]]:vgpr(s64) = G_CONSTANT i64 16
721 ; GCN-NEXT: [[PTR_ADD:%[0-9]+]]:vgpr(p4) = G_PTR_ADD [[PHI]], [[C]](s64)
722 ; GCN-NEXT: [[LOAD1:%[0-9]+]]:vgpr(<4 x s32>) = G_LOAD [[PTR_ADD]](p4) :: (load (<4 x s32>) from unknown-address + 16, addrspace 4)
723 ; GCN-NEXT: [[CONCAT_VECTORS:%[0-9]+]]:vgpr(<8 x s32>) = G_CONCAT_VECTORS [[LOAD]](<4 x s32>), [[LOAD1]](<4 x s32>)
724 ; GCN-NEXT: [[COPY2:%[0-9]+]]:sgpr(p4) = COPY [[COPY1]](p4)
725 ; GCN-NEXT: G_BR %bb.1
727 liveins: $sgpr0_sgpr1, $sgpr2_sgpr3
730 %0:_(p4) = COPY $sgpr0_sgpr1
731 %1:_(p4) = COPY $sgpr2_sgpr3
735 %2:_(p4) = G_PHI %0, %bb.0, %4, %bb.1
736 %3:_(<8 x s32>) = G_LOAD %2 :: (load (<8 x s32>), addrspace 4)
742 name: load_constant_v3i32_align4
747 liveins: $sgpr0_sgpr1
748 ; GFX7-LABEL: name: load_constant_v3i32_align4
749 ; GFX7: liveins: $sgpr0_sgpr1
751 ; GFX7-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
752 ; GFX7-NEXT: [[LOAD:%[0-9]+]]:sgpr(<2 x s32>) = G_LOAD [[COPY]](p4) :: (invariant load (<2 x s32>), align 4, addrspace 4)
753 ; GFX7-NEXT: [[C:%[0-9]+]]:sgpr(s64) = G_CONSTANT i64 8
754 ; GFX7-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p4) = G_PTR_ADD [[COPY]], [[C]](s64)
755 ; GFX7-NEXT: [[LOAD1:%[0-9]+]]:sgpr(s32) = G_LOAD [[PTR_ADD]](p4) :: (invariant load (s32) from unknown-address + 8, addrspace 4)
756 ; GFX7-NEXT: [[UV:%[0-9]+]]:sgpr(s32), [[UV1:%[0-9]+]]:sgpr(s32) = G_UNMERGE_VALUES [[LOAD]](<2 x s32>)
757 ; GFX7-NEXT: [[BUILD_VECTOR:%[0-9]+]]:sgpr(<3 x s32>) = G_BUILD_VECTOR [[UV]](s32), [[UV1]](s32), [[LOAD1]](s32)
758 ; GFX7-NEXT: S_ENDPGM 0, implicit [[BUILD_VECTOR]](<3 x s32>)
760 ; GFX12-LABEL: name: load_constant_v3i32_align4
761 ; GFX12: liveins: $sgpr0_sgpr1
763 ; GFX12-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
764 ; GFX12-NEXT: [[LOAD:%[0-9]+]]:sgpr(<3 x s32>) = G_LOAD [[COPY]](p4) :: (invariant load (<3 x s32>), align 4, addrspace 4)
765 ; GFX12-NEXT: S_ENDPGM 0, implicit [[LOAD]](<3 x s32>)
766 %0:_(p4) = COPY $sgpr0_sgpr1
767 %1:_(<3 x s32>) = G_LOAD %0 :: (invariant load (<3 x s32>), addrspace 4, align 4)
768 S_ENDPGM 0, implicit %1
772 name: load_constant_v3i32_align8
777 liveins: $sgpr0_sgpr1
778 ; GFX7-LABEL: name: load_constant_v3i32_align8
779 ; GFX7: liveins: $sgpr0_sgpr1
781 ; GFX7-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
782 ; GFX7-NEXT: [[LOAD:%[0-9]+]]:sgpr(<2 x s32>) = G_LOAD [[COPY]](p4) :: (invariant load (<2 x s32>), addrspace 4)
783 ; GFX7-NEXT: [[C:%[0-9]+]]:sgpr(s64) = G_CONSTANT i64 8
784 ; GFX7-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p4) = G_PTR_ADD [[COPY]], [[C]](s64)
785 ; GFX7-NEXT: [[LOAD1:%[0-9]+]]:sgpr(s32) = G_LOAD [[PTR_ADD]](p4) :: (invariant load (s32) from unknown-address + 8, align 8, addrspace 4)
786 ; GFX7-NEXT: [[UV:%[0-9]+]]:sgpr(s32), [[UV1:%[0-9]+]]:sgpr(s32) = G_UNMERGE_VALUES [[LOAD]](<2 x s32>)
787 ; GFX7-NEXT: [[BUILD_VECTOR:%[0-9]+]]:sgpr(<3 x s32>) = G_BUILD_VECTOR [[UV]](s32), [[UV1]](s32), [[LOAD1]](s32)
788 ; GFX7-NEXT: S_ENDPGM 0, implicit [[BUILD_VECTOR]](<3 x s32>)
790 ; GFX12-LABEL: name: load_constant_v3i32_align8
791 ; GFX12: liveins: $sgpr0_sgpr1
793 ; GFX12-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
794 ; GFX12-NEXT: [[LOAD:%[0-9]+]]:sgpr(<3 x s32>) = G_LOAD [[COPY]](p4) :: (invariant load (<3 x s32>), align 8, addrspace 4)
795 ; GFX12-NEXT: S_ENDPGM 0, implicit [[LOAD]](<3 x s32>)
796 %0:_(p4) = COPY $sgpr0_sgpr1
797 %1:_(<3 x s32>) = G_LOAD %0 :: (invariant load (<3 x s32>), addrspace 4, align 8)
798 S_ENDPGM 0, implicit %1
802 name: load_constant_v3i32_align16
807 liveins: $sgpr0_sgpr1
808 ; GFX7-LABEL: name: load_constant_v3i32_align16
809 ; GFX7: liveins: $sgpr0_sgpr1
811 ; GFX7-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
812 ; GFX7-NEXT: [[LOAD:%[0-9]+]]:sgpr(<4 x s32>) = G_LOAD [[COPY]](p4) :: (invariant load (<4 x s32>), addrspace 4)
813 ; GFX7-NEXT: [[UV:%[0-9]+]]:sgpr(s32), [[UV1:%[0-9]+]]:sgpr(s32), [[UV2:%[0-9]+]]:sgpr(s32), [[UV3:%[0-9]+]]:sgpr(s32) = G_UNMERGE_VALUES [[LOAD]](<4 x s32>)
814 ; GFX7-NEXT: [[BUILD_VECTOR:%[0-9]+]]:sgpr(<3 x s32>) = G_BUILD_VECTOR [[UV]](s32), [[UV1]](s32), [[UV2]](s32)
815 ; GFX7-NEXT: S_ENDPGM 0, implicit [[BUILD_VECTOR]](<3 x s32>)
817 ; GFX12-LABEL: name: load_constant_v3i32_align16
818 ; GFX12: liveins: $sgpr0_sgpr1
820 ; GFX12-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
821 ; GFX12-NEXT: [[LOAD:%[0-9]+]]:sgpr(<3 x s32>) = G_LOAD [[COPY]](p4) :: (invariant load (<3 x s32>), align 16, addrspace 4)
822 ; GFX12-NEXT: S_ENDPGM 0, implicit [[LOAD]](<3 x s32>)
823 %0:_(p4) = COPY $sgpr0_sgpr1
824 %1:_(<3 x s32>) = G_LOAD %0 :: (invariant load (<3 x s32>), addrspace 4, align 16)
825 S_ENDPGM 0, implicit %1
829 name: load_constant_v6i16_align4
834 liveins: $sgpr0_sgpr1
835 ; GFX7-LABEL: name: load_constant_v6i16_align4
836 ; GFX7: liveins: $sgpr0_sgpr1
838 ; GFX7-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
839 ; GFX7-NEXT: [[LOAD:%[0-9]+]]:sgpr(<4 x s16>) = G_LOAD [[COPY]](p4) :: (invariant load (<4 x s16>), align 4, addrspace 4)
840 ; GFX7-NEXT: [[C:%[0-9]+]]:sgpr(s64) = G_CONSTANT i64 8
841 ; GFX7-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p4) = G_PTR_ADD [[COPY]], [[C]](s64)
842 ; GFX7-NEXT: [[LOAD1:%[0-9]+]]:sgpr(<2 x s16>) = G_LOAD [[PTR_ADD]](p4) :: (invariant load (<2 x s16>) from unknown-address + 8, addrspace 4)
843 ; GFX7-NEXT: [[UV:%[0-9]+]]:sgpr(s16), [[UV1:%[0-9]+]]:sgpr(s16), [[UV2:%[0-9]+]]:sgpr(s16), [[UV3:%[0-9]+]]:sgpr(s16) = G_UNMERGE_VALUES [[LOAD]](<4 x s16>)
844 ; GFX7-NEXT: [[UV4:%[0-9]+]]:sgpr(s16), [[UV5:%[0-9]+]]:sgpr(s16) = G_UNMERGE_VALUES [[LOAD1]](<2 x s16>)
845 ; GFX7-NEXT: [[BUILD_VECTOR:%[0-9]+]]:sgpr(<6 x s16>) = G_BUILD_VECTOR [[UV]](s16), [[UV1]](s16), [[UV2]](s16), [[UV3]](s16), [[UV4]](s16), [[UV5]](s16)
846 ; GFX7-NEXT: S_ENDPGM 0, implicit [[BUILD_VECTOR]](<6 x s16>)
848 ; GFX12-LABEL: name: load_constant_v6i16_align4
849 ; GFX12: liveins: $sgpr0_sgpr1
851 ; GFX12-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
852 ; GFX12-NEXT: [[LOAD:%[0-9]+]]:sgpr(<6 x s16>) = G_LOAD [[COPY]](p4) :: (invariant load (<6 x s16>), align 4, addrspace 4)
853 ; GFX12-NEXT: S_ENDPGM 0, implicit [[LOAD]](<6 x s16>)
854 %0:_(p4) = COPY $sgpr0_sgpr1
855 %1:_(<6 x s16>) = G_LOAD %0 :: (invariant load (<6 x s16>), addrspace 4, align 4)
856 S_ENDPGM 0, implicit %1
860 name: load_constant_v6i16_align8
865 liveins: $sgpr0_sgpr1
866 ; GFX7-LABEL: name: load_constant_v6i16_align8
867 ; GFX7: liveins: $sgpr0_sgpr1
869 ; GFX7-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
870 ; GFX7-NEXT: [[LOAD:%[0-9]+]]:sgpr(<4 x s16>) = G_LOAD [[COPY]](p4) :: (invariant load (<4 x s16>), addrspace 4)
871 ; GFX7-NEXT: [[C:%[0-9]+]]:sgpr(s64) = G_CONSTANT i64 8
872 ; GFX7-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p4) = G_PTR_ADD [[COPY]], [[C]](s64)
873 ; GFX7-NEXT: [[LOAD1:%[0-9]+]]:sgpr(<2 x s16>) = G_LOAD [[PTR_ADD]](p4) :: (invariant load (<2 x s16>) from unknown-address + 8, align 8, addrspace 4)
874 ; GFX7-NEXT: [[UV:%[0-9]+]]:sgpr(s16), [[UV1:%[0-9]+]]:sgpr(s16), [[UV2:%[0-9]+]]:sgpr(s16), [[UV3:%[0-9]+]]:sgpr(s16) = G_UNMERGE_VALUES [[LOAD]](<4 x s16>)
875 ; GFX7-NEXT: [[UV4:%[0-9]+]]:sgpr(s16), [[UV5:%[0-9]+]]:sgpr(s16) = G_UNMERGE_VALUES [[LOAD1]](<2 x s16>)
876 ; GFX7-NEXT: [[BUILD_VECTOR:%[0-9]+]]:sgpr(<6 x s16>) = G_BUILD_VECTOR [[UV]](s16), [[UV1]](s16), [[UV2]](s16), [[UV3]](s16), [[UV4]](s16), [[UV5]](s16)
877 ; GFX7-NEXT: S_ENDPGM 0, implicit [[BUILD_VECTOR]](<6 x s16>)
879 ; GFX12-LABEL: name: load_constant_v6i16_align8
880 ; GFX12: liveins: $sgpr0_sgpr1
882 ; GFX12-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
883 ; GFX12-NEXT: [[LOAD:%[0-9]+]]:sgpr(<6 x s16>) = G_LOAD [[COPY]](p4) :: (invariant load (<6 x s16>), align 8, addrspace 4)
884 ; GFX12-NEXT: S_ENDPGM 0, implicit [[LOAD]](<6 x s16>)
885 %0:_(p4) = COPY $sgpr0_sgpr1
886 %1:_(<6 x s16>) = G_LOAD %0 :: (invariant load (<6 x s16>), addrspace 4, align 8)
887 S_ENDPGM 0, implicit %1
891 name: load_constant_v6i16_align16
896 liveins: $sgpr0_sgpr1
897 ; GFX7-LABEL: name: load_constant_v6i16_align16
898 ; GFX7: liveins: $sgpr0_sgpr1
900 ; GFX7-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
901 ; GFX7-NEXT: [[LOAD:%[0-9]+]]:sgpr(<8 x s16>) = G_LOAD [[COPY]](p4) :: (invariant load (<8 x s16>), addrspace 4)
902 ; GFX7-NEXT: [[UV:%[0-9]+]]:sgpr(s16), [[UV1:%[0-9]+]]:sgpr(s16), [[UV2:%[0-9]+]]:sgpr(s16), [[UV3:%[0-9]+]]:sgpr(s16), [[UV4:%[0-9]+]]:sgpr(s16), [[UV5:%[0-9]+]]:sgpr(s16), [[UV6:%[0-9]+]]:sgpr(s16), [[UV7:%[0-9]+]]:sgpr(s16) = G_UNMERGE_VALUES [[LOAD]](<8 x s16>)
903 ; GFX7-NEXT: [[BUILD_VECTOR:%[0-9]+]]:sgpr(<6 x s16>) = G_BUILD_VECTOR [[UV]](s16), [[UV1]](s16), [[UV2]](s16), [[UV3]](s16), [[UV4]](s16), [[UV5]](s16)
904 ; GFX7-NEXT: S_ENDPGM 0, implicit [[BUILD_VECTOR]](<6 x s16>)
906 ; GFX12-LABEL: name: load_constant_v6i16_align16
907 ; GFX12: liveins: $sgpr0_sgpr1
909 ; GFX12-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
910 ; GFX12-NEXT: [[LOAD:%[0-9]+]]:sgpr(<6 x s16>) = G_LOAD [[COPY]](p4) :: (invariant load (<6 x s16>), align 16, addrspace 4)
911 ; GFX12-NEXT: S_ENDPGM 0, implicit [[LOAD]](<6 x s16>)
912 %0:_(p4) = COPY $sgpr0_sgpr1
913 %1:_(<6 x s16>) = G_LOAD %0 :: (invariant load (<6 x s16>), addrspace 4, align 16)
914 S_ENDPGM 0, implicit %1
918 name: load_constant_i96_align4
923 liveins: $sgpr0_sgpr1
924 ; GFX7-LABEL: name: load_constant_i96_align4
925 ; GFX7: liveins: $sgpr0_sgpr1
927 ; GFX7-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
928 ; GFX7-NEXT: [[LOAD:%[0-9]+]]:sgpr(s64) = G_LOAD [[COPY]](p4) :: (invariant load (s64), align 4, addrspace 4)
929 ; GFX7-NEXT: [[C:%[0-9]+]]:sgpr(s64) = G_CONSTANT i64 8
930 ; GFX7-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p4) = G_PTR_ADD [[COPY]], [[C]](s64)
931 ; GFX7-NEXT: [[LOAD1:%[0-9]+]]:sgpr(s32) = G_LOAD [[PTR_ADD]](p4) :: (invariant load (s32) from unknown-address + 8, addrspace 4)
932 ; GFX7-NEXT: [[UV:%[0-9]+]]:sgpr(s32), [[UV1:%[0-9]+]]:sgpr(s32) = G_UNMERGE_VALUES [[LOAD]](s64)
933 ; GFX7-NEXT: [[MV:%[0-9]+]]:sgpr(s96) = G_MERGE_VALUES [[UV]](s32), [[UV1]](s32), [[LOAD1]](s32)
934 ; GFX7-NEXT: S_ENDPGM 0, implicit [[MV]](s96)
936 ; GFX12-LABEL: name: load_constant_i96_align4
937 ; GFX12: liveins: $sgpr0_sgpr1
939 ; GFX12-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
940 ; GFX12-NEXT: [[LOAD:%[0-9]+]]:sgpr(s96) = G_LOAD [[COPY]](p4) :: (invariant load (s96), align 4, addrspace 4)
941 ; GFX12-NEXT: S_ENDPGM 0, implicit [[LOAD]](s96)
942 %0:_(p4) = COPY $sgpr0_sgpr1
943 %1:_(s96) = G_LOAD %0 :: (invariant load (s96), addrspace 4, align 4)
944 S_ENDPGM 0, implicit %1
948 name: load_constant_i96_align8
953 liveins: $sgpr0_sgpr1
954 ; GFX7-LABEL: name: load_constant_i96_align8
955 ; GFX7: liveins: $sgpr0_sgpr1
957 ; GFX7-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
958 ; GFX7-NEXT: [[LOAD:%[0-9]+]]:sgpr(s64) = G_LOAD [[COPY]](p4) :: (invariant load (s64), addrspace 4)
959 ; GFX7-NEXT: [[C:%[0-9]+]]:sgpr(s64) = G_CONSTANT i64 8
960 ; GFX7-NEXT: [[PTR_ADD:%[0-9]+]]:sgpr(p4) = G_PTR_ADD [[COPY]], [[C]](s64)
961 ; GFX7-NEXT: [[LOAD1:%[0-9]+]]:sgpr(s32) = G_LOAD [[PTR_ADD]](p4) :: (invariant load (s32) from unknown-address + 8, align 8, addrspace 4)
962 ; GFX7-NEXT: [[UV:%[0-9]+]]:sgpr(s32), [[UV1:%[0-9]+]]:sgpr(s32) = G_UNMERGE_VALUES [[LOAD]](s64)
963 ; GFX7-NEXT: [[MV:%[0-9]+]]:sgpr(s96) = G_MERGE_VALUES [[UV]](s32), [[UV1]](s32), [[LOAD1]](s32)
964 ; GFX7-NEXT: S_ENDPGM 0, implicit [[MV]](s96)
966 ; GFX12-LABEL: name: load_constant_i96_align8
967 ; GFX12: liveins: $sgpr0_sgpr1
969 ; GFX12-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
970 ; GFX12-NEXT: [[LOAD:%[0-9]+]]:sgpr(s96) = G_LOAD [[COPY]](p4) :: (invariant load (s96), align 8, addrspace 4)
971 ; GFX12-NEXT: S_ENDPGM 0, implicit [[LOAD]](s96)
972 %0:_(p4) = COPY $sgpr0_sgpr1
973 %1:_(s96) = G_LOAD %0 :: (invariant load (s96), addrspace 4, align 8)
974 S_ENDPGM 0, implicit %1
978 name: load_constant_i96_align16
983 liveins: $sgpr0_sgpr1
984 ; GFX7-LABEL: name: load_constant_i96_align16
985 ; GFX7: liveins: $sgpr0_sgpr1
987 ; GFX7-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
988 ; GFX7-NEXT: [[LOAD:%[0-9]+]]:sgpr(s128) = G_LOAD [[COPY]](p4) :: (invariant load (s128), addrspace 4)
989 ; GFX7-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s96) = G_TRUNC [[LOAD]](s128)
990 ; GFX7-NEXT: S_ENDPGM 0, implicit [[TRUNC]](s96)
992 ; GFX12-LABEL: name: load_constant_i96_align16
993 ; GFX12: liveins: $sgpr0_sgpr1
995 ; GFX12-NEXT: [[COPY:%[0-9]+]]:sgpr(p4) = COPY $sgpr0_sgpr1
996 ; GFX12-NEXT: [[LOAD:%[0-9]+]]:sgpr(s96) = G_LOAD [[COPY]](p4) :: (invariant load (s96), align 16, addrspace 4)
997 ; GFX12-NEXT: S_ENDPGM 0, implicit [[LOAD]](s96)
998 %0:_(p4) = COPY $sgpr0_sgpr1
999 %1:_(s96) = G_LOAD %0 :: (invariant load (s96), addrspace 4, align 16)
1000 S_ENDPGM 0, implicit %1