Lines Matching +full:opt +full:- +full:out
1 ; RUN: opt -S -codegenprepare -mtriple=amdgcn-unknown-unknown -mcpu=tahiti < %s | FileCheck -check-…
2 ; RUN: opt -S -codegenprepare -mtriple=amdgcn-unknown-unknown -mcpu=bonaire < %s | FileCheck -check…
3 ; RUN: opt -S -codegenprepare -mtriple=amdgcn-unknown-unknown -mcpu=tonga < %s | FileCheck -check-p…
4 ; RUN: llc -march=amdgcn -mcpu=tahiti -mattr=-promote-alloca -amdgpu-sroa=0 < %s | FileCheck -check…
5 ; RUN: llc -march=amdgcn -mcpu=bonaire -mattr=-promote-alloca -amdgpu-sroa=0 < %s | FileCheck -chec…
6 ; RUN: llc -march=amdgcn -mcpu=tonga -mattr=-promote-alloca -amdgpu-sroa=0 < %s | FileCheck -check-…
8 ; OPT-LABEL: @test_sink_global_small_offset_i32(
9 ; OPT-CI-NOT: getelementptr i32, i32 addrspace(1)* %in
10 ; OPT-VI: getelementptr i32, i32 addrspace(1)* %in
11 ; OPT: br i1
12 ; OPT-CI: ptrtoint
14 ; GCN-LABEL: {{^}}test_sink_global_small_offset_i32:
16 define void @test_sink_global_small_offset_i32(i32 addrspace(1)* %out, i32 addrspace(1)* %in) {
18 %out.gep = getelementptr i32, i32 addrspace(1)* %out, i64 999999
20 %tid = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #0
30 store i32 %x, i32 addrspace(1)* %out.gep
37 ; OPT-LABEL: @test_sink_global_small_max_i32_ds_offset(
38 ; OPT: %in.gep = getelementptr i8, i8 addrspace(1)* %in, i64 65535
39 ; OPT: br i1
41 ; GCN-LABEL: {{^}}test_sink_global_small_max_i32_ds_offset:
43 ; GCN: buffer_load_sbyte {{v[0-9]+}}, off, {{s\[[0-9]+:[0-9]+\]}}, s{{[0-9]+$}}
46 define void @test_sink_global_small_max_i32_ds_offset(i32 addrspace(1)* %out, i8 addrspace(1)* %in)…
48 %out.gep = getelementptr i32, i32 addrspace(1)* %out, i64 99999
50 %tid = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #0
61 store i32 %x, i32 addrspace(1)* %out.gep
68 ; GCN-LABEL: {{^}}test_sink_global_small_max_mubuf_offset:
70 ; GCN: buffer_load_sbyte {{v[0-9]+}}, off, {{s\[[0-9]+:[0-9]+\]}}, 0 offset:4095{{$}}
73 define void @test_sink_global_small_max_mubuf_offset(i32 addrspace(1)* %out, i8 addrspace(1)* %in) {
75 %out.gep = getelementptr i32, i32 addrspace(1)* %out, i32 1024
77 %tid = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #0
88 store i32 %x, i32 addrspace(1)* %out.gep
95 ; GCN-LABEL: {{^}}test_sink_global_small_max_plus_1_mubuf_offset:
97 ; GCN: buffer_load_sbyte {{v[0-9]+}}, off, {{s\[[0-9]+:[0-9]+\]}}, s{{[0-9]+$}}
100 define void @test_sink_global_small_max_plus_1_mubuf_offset(i32 addrspace(1)* %out, i8 addrspace(1)…
102 %out.gep = getelementptr i32, i32 addrspace(1)* %out, i64 99999
104 %tid = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #0
115 store i32 %x, i32 addrspace(1)* %out.gep
122 ; OPT-LABEL: @test_sink_scratch_small_offset_i32(
123 ; OPT-NOT: getelementptr [512 x i32]
124 ; OPT: br i1
125 ; OPT: ptrtoint
127 ; GCN-LABEL: {{^}}test_sink_scratch_small_offset_i32:
129 ; GCN: buffer_store_dword {{v[0-9]+}}, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, {{s[0-9]+}} offen offse…
130 ; GCN: buffer_load_dword {{v[0-9]+}}, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, {{s[0-9]+}} offen offset…
132 define void @test_sink_scratch_small_offset_i32(i32 addrspace(1)* %out, i32 addrspace(1)* %in, i32 …
135 %out.gep.0 = getelementptr i32, i32 addrspace(1)* %out, i64 999998
136 %out.gep.1 = getelementptr i32, i32 addrspace(1)* %out, i64 999999
139 %tid = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #0
150 store i32 %x, i32 addrspace(1)* %out.gep.0
152 store i32 %load, i32 addrspace(1)* %out.gep.1
159 ; OPT-LABEL: @test_no_sink_scratch_large_offset_i32(
160 ; OPT: %alloca.gep = getelementptr [512 x i32], [512 x i32]* %alloca, i32 0, i32 1024
161 ; OPT: br i1
162 ; OPT-NOT: ptrtoint
164 ; GCN-LABEL: {{^}}test_no_sink_scratch_large_offset_i32:
166 ; GCN: buffer_store_dword {{v[0-9]+}}, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, {{s[0-9]+}} offen{{$}}
167 ; GCN: buffer_load_dword {{v[0-9]+}}, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, {{s[0-9]+}} offen{{$}}
169 define void @test_no_sink_scratch_large_offset_i32(i32 addrspace(1)* %out, i32 addrspace(1)* %in, i…
172 %out.gep.0 = getelementptr i32, i32 addrspace(1)* %out, i64 999998
173 %out.gep.1 = getelementptr i32, i32 addrspace(1)* %out, i64 999999
176 %tid = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #0
187 store i32 %x, i32 addrspace(1)* %out.gep.0
189 store i32 %load, i32 addrspace(1)* %out.gep.1
196 ; GCN-LABEL: {{^}}test_sink_global_vreg_sreg_i32:
198 ; CI: buffer_load_dword {{v[0-9]+}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, 0 addr64{{$}}
199 ; VI: flat_load_dword v{{[0-9]+}}, v[{{[0-9]+:[0-9]+}}]
201 define void @test_sink_global_vreg_sreg_i32(i32 addrspace(1)* %out, i32 addrspace(1)* %in, i32 %off…
204 %out.gep = getelementptr i32, i32 addrspace(1)* %out, i64 999999
206 %tid = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #0
216 store i32 %x, i32 addrspace(1)* %out.gep
228 ; OPT-LABEL: @test_sink_constant_small_offset_i32
229 ; OPT-NOT: getelementptr i32, i32 addrspace(2)*
230 ; OPT: br i1
232 ; GCN-LABEL: {{^}}test_sink_constant_small_offset_i32:
234 ; SI: s_load_dword s{{[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, 0x7{{$}}
236 define void @test_sink_constant_small_offset_i32(i32 addrspace(1)* %out, i32 addrspace(2)* %in) {
238 %out.gep = getelementptr i32, i32 addrspace(1)* %out, i64 999999
240 %tid = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #0
250 store i32 %x, i32 addrspace(1)* %out.gep
257 ; OPT-LABEL: @test_sink_constant_max_8_bit_offset_i32
258 ; OPT-NOT: getelementptr i32, i32 addrspace(2)*
259 ; OPT: br i1
261 ; GCN-LABEL: {{^}}test_sink_constant_max_8_bit_offset_i32:
263 ; SI: s_load_dword s{{[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, 0xff{{$}}
265 define void @test_sink_constant_max_8_bit_offset_i32(i32 addrspace(1)* %out, i32 addrspace(2)* %in)…
267 %out.gep = getelementptr i32, i32 addrspace(1)* %out, i64 999999
269 %tid = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #0
279 store i32 %x, i32 addrspace(1)* %out.gep
286 ; OPT-LABEL: @test_sink_constant_max_8_bit_offset_p1_i32
287 ; OPT-SI: getelementptr i32, i32 addrspace(2)*
288 ; OPT-CI-NOT: getelementptr i32, i32 addrspace(2)*
289 ; OPT-VI-NOT: getelementptr i32, i32 addrspace(2)*
290 ; OPT: br i1
292 ; GCN-LABEL: {{^}}test_sink_constant_max_8_bit_offset_p1_i32:
294 ; SI: s_movk_i32 [[OFFSET:s[0-9]+]], 0x400
296 ; SI: s_load_dword s{{[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, [[OFFSET]]{{$}}
298 define void @test_sink_constant_max_8_bit_offset_p1_i32(i32 addrspace(1)* %out, i32 addrspace(2)* %…
300 %out.gep = getelementptr i32, i32 addrspace(1)* %out, i64 999999
302 %tid = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #0
312 store i32 %x, i32 addrspace(1)* %out.gep
319 ; OPT-LABEL: @test_sink_constant_max_32_bit_offset_i32
320 ; OPT-SI: getelementptr i32, i32 addrspace(2)*
321 ; OPT-CI-NOT: getelementptr i32, i32 addrspace(2)*
322 ; OPT: br i1
324 ; GCN-LABEL: {{^}}test_sink_constant_max_32_bit_offset_i32:
326 ; GCN: s_add_u32 s{{[0-9]+}}, s{{[0-9]+}}, -4{{$}}
327 ; GCN: s_addc_u32 s{{[0-9]+}}, s{{[0-9]+}}, 3{{$}}
328 ; SI: s_load_dword s{{[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, 0x0{{$}}
330 define void @test_sink_constant_max_32_bit_offset_i32(i32 addrspace(1)* %out, i32 addrspace(2)* %in…
332 %out.gep = getelementptr i32, i32 addrspace(1)* %out, i64 999999
334 %tid = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #0
344 store i32 %x, i32 addrspace(1)* %out.gep
351 ; OPT-LABEL: @test_sink_constant_max_32_bit_offset_p1_i32
352 ; OPT: getelementptr i32, i32 addrspace(2)*
353 ; OPT: br i1
355 ; GCN-LABEL: {{^}}test_sink_constant_max_32_bit_offset_p1_i32:
359 ; SI: s_load_dword s{{[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, 0x0{{$}}
361 define void @test_sink_constant_max_32_bit_offset_p1_i32(i32 addrspace(1)* %out, i32 addrspace(2)* …
363 %out.gep = getelementptr i32, i32 addrspace(1)* %out, i64 999999
365 %tid = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #0
375 store i32 %x, i32 addrspace(1)* %out.gep
382 ; GCN-LABEL: {{^}}test_sink_constant_max_20_bit_byte_offset_i32:
384 ; SI: s_mov_b32 [[OFFSET:s[0-9]+]], 0xffffc{{$}}
385 ; SI: s_load_dword s{{[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, [[OFFSET]]{{$}}
387 ; CI: s_load_dword s{{[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, 0x3ffff{{$}}
388 ; VI: s_load_dword s{{[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, 0xffffc{{$}}
391 define void @test_sink_constant_max_20_bit_byte_offset_i32(i32 addrspace(1)* %out, i32 addrspace(2)…
393 %out.gep = getelementptr i32, i32 addrspace(1)* %out, i64 999999
395 %tid = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #0
405 store i32 %x, i32 addrspace(1)* %out.gep
412 ; OPT-LABEL: @test_sink_constant_max_20_bit_byte_offset_p1_i32
413 ; OPT-SI: getelementptr i32, i32 addrspace(2)*
414 ; OPT-CI-NOT: getelementptr i32, i32 addrspace(2)*
415 ; OPT-VI: getelementptr i32, i32 addrspace(2)*
416 ; OPT: br i1
418 ; GCN-LABEL: {{^}}test_sink_constant_max_20_bit_byte_offset_p1_i32:
420 ; SI: s_mov_b32 [[OFFSET:s[0-9]+]], 0x100000{{$}}
421 ; SI: s_load_dword s{{[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, [[OFFSET]]{{$}}
423 ; CI: s_load_dword s{{[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, 0x40000{{$}}
425 ; VI: s_mov_b32 [[OFFSET:s[0-9]+]], 0x100000{{$}}
426 ; VI: s_load_dword s{{[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, [[OFFSET]]{{$}}
429 define void @test_sink_constant_max_20_bit_byte_offset_p1_i32(i32 addrspace(1)* %out, i32 addrspace…
431 %out.gep = getelementptr i32, i32 addrspace(1)* %out, i64 999999
433 %tid = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #0
443 store i32 %x, i32 addrspace(1)* %out.gep
452 ; OPT-LABEL: @sink_ds_address(
453 ; OPT: ptrtoint %struct.foo addrspace(3)* %ptr to i64
455 ; GCN-LABEL: {{^}}sink_ds_address:
456 ; GCN: s_load_dword [[SREG1:s[0-9]+]],
457 ; GCN: v_mov_b32_e32 [[VREG1:v[0-9]+]], [[SREG1]]
458 ; GCN-DAG: ds_read2_b32 v[{{[0-9+:[0-9]+}}], [[VREG1]] offset0:3 offset1:5