2020-09-10 19:06:12 +02:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2021-01-06 05:23:39 +01:00
|
|
|
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx906 < %s | FileCheck --check-prefix=MUBUF %s
|
|
|
|
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx906 --amdgpu-enable-flat-scratch < %s | FileCheck --check-prefix=FLATSCR %s
|
2020-09-10 19:06:12 +02:00
|
|
|
|
|
|
|
; Make sure we use the correct frame offset is used with the local
|
|
|
|
; frame area.
|
|
|
|
;
|
|
|
|
; %pin.low is allocated to offset 0.
|
|
|
|
;
|
|
|
|
; %local.area is assigned to the local frame offset by the
|
|
|
|
; LocalStackSlotAllocation pass at offset 4096.
|
|
|
|
;
|
|
|
|
; The %load1 access to %gep.large.offset initially used the stack
|
|
|
|
; pointer register and directly referenced the frame index. After
|
|
|
|
; LocalStackSlotAllocation, it would no longer refer to a frame index
|
|
|
|
; so eliminateFrameIndex would not adjust the access to use the
|
|
|
|
; correct FP offset.
|
|
|
|
|
2021-01-22 08:24:16 +01:00
|
|
|
define amdgpu_kernel void @local_stack_offset_uses_sp(i64 addrspace(1)* %out) {
|
2020-10-21 23:27:03 +02:00
|
|
|
; MUBUF-LABEL: local_stack_offset_uses_sp:
|
|
|
|
; MUBUF: ; %bb.0: ; %entry
|
|
|
|
; MUBUF-NEXT: s_load_dwordx2 s[4:5], s[4:5], 0x0
|
|
|
|
; MUBUF-NEXT: s_add_u32 flat_scratch_lo, s6, s9
|
|
|
|
; MUBUF-NEXT: s_addc_u32 flat_scratch_hi, s7, 0
|
|
|
|
; MUBUF-NEXT: s_add_u32 s0, s0, s9
|
|
|
|
; MUBUF-NEXT: v_mov_b32_e32 v1, 0x3000
|
|
|
|
; MUBUF-NEXT: s_addc_u32 s1, s1, 0
|
|
|
|
; MUBUF-NEXT: v_add_u32_e32 v0, 64, v1
|
|
|
|
; MUBUF-NEXT: v_mov_b32_e32 v2, 0
|
|
|
|
; MUBUF-NEXT: v_mov_b32_e32 v3, 0x2000
|
|
|
|
; MUBUF-NEXT: s_mov_b32 s6, 0
|
|
|
|
; MUBUF-NEXT: buffer_store_dword v2, v3, s[0:3], 0 offen
|
2020-12-19 03:05:11 +01:00
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
2020-10-21 23:27:03 +02:00
|
|
|
; MUBUF-NEXT: BB0_1: ; %loadstoreloop
|
|
|
|
; MUBUF-NEXT: ; =>This Inner Loop Header: Depth=1
|
|
|
|
; MUBUF-NEXT: v_add_u32_e32 v3, s6, v1
|
|
|
|
; MUBUF-NEXT: s_add_i32 s6, s6, 1
|
|
|
|
; MUBUF-NEXT: s_cmpk_lt_u32 s6, 0x2120
|
|
|
|
; MUBUF-NEXT: buffer_store_byte v2, v3, s[0:3], 0 offen
|
2020-12-19 03:05:11 +01:00
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
2020-10-21 23:27:03 +02:00
|
|
|
; MUBUF-NEXT: s_cbranch_scc1 BB0_1
|
|
|
|
; MUBUF-NEXT: ; %bb.2: ; %split
|
|
|
|
; MUBUF-NEXT: v_mov_b32_e32 v1, 0x3000
|
|
|
|
; MUBUF-NEXT: v_add_u32_e32 v1, 0x20d0, v1
|
2020-12-19 03:05:11 +01:00
|
|
|
; MUBUF-NEXT: buffer_load_dword v2, v1, s[0:3], 0 offen glc
|
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
2020-11-30 18:06:35 +01:00
|
|
|
; MUBUF-NEXT: buffer_load_dword v3, v1, s[0:3], 0 offen offset:4 glc
|
2020-12-19 03:05:11 +01:00
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
2020-11-30 18:06:35 +01:00
|
|
|
; MUBUF-NEXT: buffer_load_dword v4, v0, s[0:3], 0 offen glc
|
2020-12-19 03:05:11 +01:00
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
2020-11-30 18:06:35 +01:00
|
|
|
; MUBUF-NEXT: buffer_load_dword v5, v0, s[0:3], 0 offen offset:4 glc
|
2020-10-21 23:27:03 +02:00
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
2020-11-30 18:06:35 +01:00
|
|
|
; MUBUF-NEXT: v_add_co_u32_e32 v0, vcc, v2, v4
|
|
|
|
; MUBUF-NEXT: v_addc_co_u32_e32 v1, vcc, v3, v5, vcc
|
2020-11-10 17:06:59 +01:00
|
|
|
; MUBUF-NEXT: v_mov_b32_e32 v2, 0
|
|
|
|
; MUBUF-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; MUBUF-NEXT: global_store_dwordx2 v2, v[0:1], s[4:5]
|
2020-12-19 03:05:11 +01:00
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
2020-10-21 23:27:03 +02:00
|
|
|
; MUBUF-NEXT: s_endpgm
|
|
|
|
;
|
|
|
|
; FLATSCR-LABEL: local_stack_offset_uses_sp:
|
|
|
|
; FLATSCR: ; %bb.0: ; %entry
|
2020-11-06 22:00:10 +01:00
|
|
|
; FLATSCR-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x0
|
|
|
|
; FLATSCR-NEXT: s_add_u32 flat_scratch_lo, s2, s5
|
|
|
|
; FLATSCR-NEXT: s_addc_u32 flat_scratch_hi, s3, 0
|
2020-10-21 23:27:03 +02:00
|
|
|
; FLATSCR-NEXT: v_mov_b32_e32 v0, 0
|
|
|
|
; FLATSCR-NEXT: s_movk_i32 vcc_hi, 0x2000
|
2020-11-06 22:00:10 +01:00
|
|
|
; FLATSCR-NEXT: s_mov_b32 s2, 0
|
2020-10-21 23:27:03 +02:00
|
|
|
; FLATSCR-NEXT: scratch_store_dword off, v0, vcc_hi
|
2020-12-19 03:05:11 +01:00
|
|
|
; FLATSCR-NEXT: s_waitcnt vmcnt(0)
|
2020-10-21 23:27:03 +02:00
|
|
|
; FLATSCR-NEXT: BB0_1: ; %loadstoreloop
|
|
|
|
; FLATSCR-NEXT: ; =>This Inner Loop Header: Depth=1
|
2020-11-06 22:00:10 +01:00
|
|
|
; FLATSCR-NEXT: s_add_u32 s3, 0x3000, s2
|
|
|
|
; FLATSCR-NEXT: s_add_i32 s2, s2, 1
|
|
|
|
; FLATSCR-NEXT: s_cmpk_lt_u32 s2, 0x2120
|
|
|
|
; FLATSCR-NEXT: scratch_store_byte off, v0, s3
|
2020-12-19 03:05:11 +01:00
|
|
|
; FLATSCR-NEXT: s_waitcnt vmcnt(0)
|
2020-10-21 23:27:03 +02:00
|
|
|
; FLATSCR-NEXT: s_cbranch_scc1 BB0_1
|
|
|
|
; FLATSCR-NEXT: ; %bb.2: ; %split
|
2020-11-06 22:00:10 +01:00
|
|
|
; FLATSCR-NEXT: s_movk_i32 s2, 0x2000
|
|
|
|
; FLATSCR-NEXT: s_add_u32 s2, 0x3000, s2
|
2020-12-19 03:05:11 +01:00
|
|
|
; FLATSCR-NEXT: scratch_load_dwordx2 v[0:1], off, s2 offset:208 glc
|
|
|
|
; FLATSCR-NEXT: s_waitcnt vmcnt(0)
|
2020-11-06 22:00:10 +01:00
|
|
|
; FLATSCR-NEXT: s_movk_i32 s2, 0x3000
|
2020-12-19 03:05:11 +01:00
|
|
|
; FLATSCR-NEXT: scratch_load_dwordx2 v[2:3], off, s2 offset:64 glc
|
2020-10-21 23:27:03 +02:00
|
|
|
; FLATSCR-NEXT: s_waitcnt vmcnt(0)
|
2020-11-12 22:04:33 +01:00
|
|
|
; FLATSCR-NEXT: v_add_co_u32_e32 v0, vcc, v0, v2
|
|
|
|
; FLATSCR-NEXT: v_addc_co_u32_e32 v1, vcc, v1, v3, vcc
|
2020-11-10 17:06:59 +01:00
|
|
|
; FLATSCR-NEXT: v_mov_b32_e32 v2, 0
|
2020-10-21 23:27:03 +02:00
|
|
|
; FLATSCR-NEXT: s_waitcnt lgkmcnt(0)
|
2020-11-10 17:06:59 +01:00
|
|
|
; FLATSCR-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
|
2020-12-19 03:05:11 +01:00
|
|
|
; FLATSCR-NEXT: s_waitcnt vmcnt(0)
|
2020-10-21 23:27:03 +02:00
|
|
|
; FLATSCR-NEXT: s_endpgm
|
2020-09-10 19:06:12 +02:00
|
|
|
entry:
|
|
|
|
%pin.low = alloca i32, align 8192, addrspace(5)
|
|
|
|
%local.area = alloca [1060 x i64], align 4096, addrspace(5)
|
|
|
|
store volatile i32 0, i32 addrspace(5)* %pin.low
|
|
|
|
%local.area.cast = bitcast [1060 x i64] addrspace(5)* %local.area to i8 addrspace(5)*
|
|
|
|
call void @llvm.memset.p5i8.i32(i8 addrspace(5)* align 4 %local.area.cast, i8 0, i32 8480, i1 true)
|
|
|
|
%gep.large.offset = getelementptr inbounds [1060 x i64], [1060 x i64] addrspace(5)* %local.area, i64 0, i64 1050
|
|
|
|
%gep.small.offset = getelementptr inbounds [1060 x i64], [1060 x i64] addrspace(5)* %local.area, i64 0, i64 8
|
|
|
|
%load0 = load volatile i64, i64 addrspace(5)* %gep.large.offset
|
|
|
|
%load1 = load volatile i64, i64 addrspace(5)* %gep.small.offset
|
|
|
|
%add0 = add i64 %load0, %load1
|
|
|
|
store volatile i64 %add0, i64 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2021-01-22 08:24:16 +01:00
|
|
|
define void @func_local_stack_offset_uses_sp(i64 addrspace(1)* %out) {
|
2020-10-21 23:27:03 +02:00
|
|
|
; MUBUF-LABEL: func_local_stack_offset_uses_sp:
|
|
|
|
; MUBUF: ; %bb.0: ; %entry
|
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; MUBUF-NEXT: s_add_u32 s4, s32, 0x7ffc0
|
|
|
|
; MUBUF-NEXT: s_mov_b32 s5, s33
|
|
|
|
; MUBUF-NEXT: s_and_b32 s33, s4, 0xfff80000
|
|
|
|
; MUBUF-NEXT: v_lshrrev_b32_e64 v3, 6, s33
|
|
|
|
; MUBUF-NEXT: v_add_u32_e32 v3, 0x1000, v3
|
|
|
|
; MUBUF-NEXT: v_mov_b32_e32 v4, 0
|
|
|
|
; MUBUF-NEXT: v_add_u32_e32 v2, 64, v3
|
|
|
|
; MUBUF-NEXT: s_mov_b32 s4, 0
|
|
|
|
; MUBUF-NEXT: s_add_u32 s32, s32, 0x180000
|
|
|
|
; MUBUF-NEXT: buffer_store_dword v4, off, s[0:3], s33
|
2020-12-19 03:05:11 +01:00
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
2020-10-21 23:27:03 +02:00
|
|
|
; MUBUF-NEXT: BB1_1: ; %loadstoreloop
|
|
|
|
; MUBUF-NEXT: ; =>This Inner Loop Header: Depth=1
|
|
|
|
; MUBUF-NEXT: v_add_u32_e32 v5, s4, v3
|
|
|
|
; MUBUF-NEXT: s_add_i32 s4, s4, 1
|
|
|
|
; MUBUF-NEXT: s_cmpk_lt_u32 s4, 0x2120
|
|
|
|
; MUBUF-NEXT: buffer_store_byte v4, v5, s[0:3], 0 offen
|
2020-12-19 03:05:11 +01:00
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
2020-10-21 23:27:03 +02:00
|
|
|
; MUBUF-NEXT: s_cbranch_scc1 BB1_1
|
|
|
|
; MUBUF-NEXT: ; %bb.2: ; %split
|
|
|
|
; MUBUF-NEXT: v_lshrrev_b32_e64 v3, 6, s33
|
|
|
|
; MUBUF-NEXT: v_add_u32_e32 v3, 0x1000, v3
|
|
|
|
; MUBUF-NEXT: v_add_u32_e32 v3, 0x20d0, v3
|
2020-12-19 03:05:11 +01:00
|
|
|
; MUBUF-NEXT: buffer_load_dword v4, v3, s[0:3], 0 offen glc
|
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
2020-11-30 18:06:35 +01:00
|
|
|
; MUBUF-NEXT: buffer_load_dword v5, v3, s[0:3], 0 offen offset:4 glc
|
2020-12-19 03:05:11 +01:00
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
2020-11-30 18:06:35 +01:00
|
|
|
; MUBUF-NEXT: buffer_load_dword v6, v2, s[0:3], 0 offen glc
|
2020-12-19 03:05:11 +01:00
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
2020-11-30 18:06:35 +01:00
|
|
|
; MUBUF-NEXT: buffer_load_dword v7, v2, s[0:3], 0 offen offset:4 glc
|
2020-12-19 03:05:11 +01:00
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
2020-10-21 23:27:03 +02:00
|
|
|
; MUBUF-NEXT: s_sub_u32 s32, s32, 0x180000
|
|
|
|
; MUBUF-NEXT: s_mov_b32 s33, s5
|
2020-11-30 18:06:35 +01:00
|
|
|
; MUBUF-NEXT: v_add_co_u32_e32 v2, vcc, v4, v6
|
|
|
|
; MUBUF-NEXT: v_addc_co_u32_e32 v3, vcc, v5, v7, vcc
|
2020-10-21 23:27:03 +02:00
|
|
|
; MUBUF-NEXT: global_store_dwordx2 v[0:1], v[2:3], off
|
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; MUBUF-NEXT: s_setpc_b64 s[30:31]
|
|
|
|
;
|
|
|
|
; FLATSCR-LABEL: func_local_stack_offset_uses_sp:
|
|
|
|
; FLATSCR: ; %bb.0: ; %entry
|
|
|
|
; FLATSCR-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
2020-11-06 22:00:10 +01:00
|
|
|
; FLATSCR-NEXT: s_add_u32 s0, s32, 0x1fff
|
|
|
|
; FLATSCR-NEXT: s_mov_b32 s2, s33
|
|
|
|
; FLATSCR-NEXT: s_and_b32 s33, s0, 0xffffe000
|
2020-10-21 23:27:03 +02:00
|
|
|
; FLATSCR-NEXT: v_mov_b32_e32 v2, 0
|
2020-11-06 22:00:10 +01:00
|
|
|
; FLATSCR-NEXT: s_mov_b32 s0, 0
|
2020-10-21 23:27:03 +02:00
|
|
|
; FLATSCR-NEXT: s_add_u32 s32, s32, 0x6000
|
|
|
|
; FLATSCR-NEXT: scratch_store_dword off, v2, s33
|
2020-12-19 03:05:11 +01:00
|
|
|
; FLATSCR-NEXT: s_waitcnt vmcnt(0)
|
2020-10-21 23:27:03 +02:00
|
|
|
; FLATSCR-NEXT: BB1_1: ; %loadstoreloop
|
|
|
|
; FLATSCR-NEXT: ; =>This Inner Loop Header: Depth=1
|
|
|
|
; FLATSCR-NEXT: s_add_u32 vcc_hi, s33, 0x1000
|
2020-11-06 22:00:10 +01:00
|
|
|
; FLATSCR-NEXT: s_add_u32 s1, vcc_hi, s0
|
|
|
|
; FLATSCR-NEXT: s_add_i32 s0, s0, 1
|
|
|
|
; FLATSCR-NEXT: s_cmpk_lt_u32 s0, 0x2120
|
|
|
|
; FLATSCR-NEXT: scratch_store_byte off, v2, s1
|
2020-12-19 03:05:11 +01:00
|
|
|
; FLATSCR-NEXT: s_waitcnt vmcnt(0)
|
2020-10-21 23:27:03 +02:00
|
|
|
; FLATSCR-NEXT: s_cbranch_scc1 BB1_1
|
|
|
|
; FLATSCR-NEXT: ; %bb.2: ; %split
|
2020-11-06 22:00:10 +01:00
|
|
|
; FLATSCR-NEXT: s_movk_i32 s0, 0x2000
|
|
|
|
; FLATSCR-NEXT: s_add_u32 s1, s33, 0x1000
|
|
|
|
; FLATSCR-NEXT: s_add_u32 s0, s1, s0
|
2020-12-19 03:05:11 +01:00
|
|
|
; FLATSCR-NEXT: scratch_load_dwordx2 v[2:3], off, s0 offset:208 glc
|
|
|
|
; FLATSCR-NEXT: s_waitcnt vmcnt(0)
|
2020-11-06 22:00:10 +01:00
|
|
|
; FLATSCR-NEXT: s_add_u32 s0, s33, 0x1000
|
2020-12-19 03:05:11 +01:00
|
|
|
; FLATSCR-NEXT: scratch_load_dwordx2 v[4:5], off, s0 offset:64 glc
|
|
|
|
; FLATSCR-NEXT: s_waitcnt vmcnt(0)
|
2020-10-21 23:27:03 +02:00
|
|
|
; FLATSCR-NEXT: s_sub_u32 s32, s32, 0x6000
|
2020-11-06 22:00:10 +01:00
|
|
|
; FLATSCR-NEXT: s_mov_b32 s33, s2
|
2020-11-12 22:04:33 +01:00
|
|
|
; FLATSCR-NEXT: v_add_co_u32_e32 v2, vcc, v2, v4
|
|
|
|
; FLATSCR-NEXT: v_addc_co_u32_e32 v3, vcc, v3, v5, vcc
|
2020-10-21 23:27:03 +02:00
|
|
|
; FLATSCR-NEXT: global_store_dwordx2 v[0:1], v[2:3], off
|
|
|
|
; FLATSCR-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; FLATSCR-NEXT: s_setpc_b64 s[30:31]
|
2020-09-10 19:06:12 +02:00
|
|
|
entry:
|
|
|
|
%pin.low = alloca i32, align 8192, addrspace(5)
|
|
|
|
%local.area = alloca [1060 x i64], align 4096, addrspace(5)
|
|
|
|
store volatile i32 0, i32 addrspace(5)* %pin.low
|
|
|
|
%local.area.cast = bitcast [1060 x i64] addrspace(5)* %local.area to i8 addrspace(5)*
|
|
|
|
call void @llvm.memset.p5i8.i32(i8 addrspace(5)* align 4 %local.area.cast, i8 0, i32 8480, i1 true)
|
|
|
|
%gep.large.offset = getelementptr inbounds [1060 x i64], [1060 x i64] addrspace(5)* %local.area, i64 0, i64 1050
|
|
|
|
%gep.small.offset = getelementptr inbounds [1060 x i64], [1060 x i64] addrspace(5)* %local.area, i64 0, i64 8
|
|
|
|
%load0 = load volatile i64, i64 addrspace(5)* %gep.large.offset
|
|
|
|
%load1 = load volatile i64, i64 addrspace(5)* %gep.small.offset
|
|
|
|
%add0 = add i64 %load0, %load1
|
|
|
|
store volatile i64 %add0, i64 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2021-01-22 20:06:14 +01:00
|
|
|
define amdgpu_kernel void @local_stack_offset_uses_sp_flat(<3 x i64> addrspace(1)* %out) {
|
|
|
|
; MUBUF-LABEL: local_stack_offset_uses_sp_flat:
|
|
|
|
; MUBUF: ; %bb.0: ; %entry
|
|
|
|
; MUBUF-NEXT: s_load_dwordx2 s[4:5], s[4:5], 0x0
|
|
|
|
; MUBUF-NEXT: s_add_u32 flat_scratch_lo, s6, s9
|
|
|
|
; MUBUF-NEXT: s_addc_u32 flat_scratch_hi, s7, 0
|
|
|
|
; MUBUF-NEXT: s_add_u32 s0, s0, s9
|
|
|
|
; MUBUF-NEXT: s_addc_u32 s1, s1, 0
|
|
|
|
; MUBUF-NEXT: v_mov_b32_e32 v0, 0x4000
|
|
|
|
; MUBUF-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; MUBUF-NEXT: v_mov_b32_e32 v2, 0x2000
|
|
|
|
; MUBUF-NEXT: s_mov_b32 s6, 0
|
|
|
|
; MUBUF-NEXT: buffer_store_dword v1, v2, s[0:3], 0 offen
|
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; MUBUF-NEXT: BB2_1: ; %loadstoreloop
|
|
|
|
; MUBUF-NEXT: ; =>This Inner Loop Header: Depth=1
|
|
|
|
; MUBUF-NEXT: v_add_u32_e32 v2, s6, v0
|
|
|
|
; MUBUF-NEXT: s_add_i32 s6, s6, 1
|
|
|
|
; MUBUF-NEXT: s_cmpk_lt_u32 s6, 0x2120
|
|
|
|
; MUBUF-NEXT: buffer_store_byte v1, v2, s[0:3], 0 offen
|
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; MUBUF-NEXT: s_cbranch_scc1 BB2_1
|
|
|
|
; MUBUF-NEXT: ; %bb.2: ; %split
|
|
|
|
; MUBUF-NEXT: v_mov_b32_e32 v0, 0x4000
|
|
|
|
; MUBUF-NEXT: v_or_b32_e32 v2, 0x12d4, v0
|
|
|
|
; MUBUF-NEXT: buffer_load_dword v5, v2, s[0:3], 0 offen glc
|
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; MUBUF-NEXT: v_or_b32_e32 v2, 0x12d0, v0
|
|
|
|
; MUBUF-NEXT: buffer_load_dword v4, v2, s[0:3], 0 offen glc
|
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; MUBUF-NEXT: v_or_b32_e32 v1, 0x12c0, v0
|
|
|
|
; MUBUF-NEXT: v_or_b32_e32 v2, 0x12c4, v0
|
|
|
|
; MUBUF-NEXT: buffer_load_dword v6, v2, s[0:3], 0 offen glc
|
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
2020-11-30 18:06:35 +01:00
|
|
|
; MUBUF-NEXT: buffer_load_dword v7, v1, s[0:3], 0 offen glc
|
2021-01-22 20:06:14 +01:00
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
2020-11-30 18:06:35 +01:00
|
|
|
; MUBUF-NEXT: v_or_b32_e32 v1, 0x12cc, v0
|
2021-01-22 20:06:14 +01:00
|
|
|
; MUBUF-NEXT: v_or_b32_e32 v0, 0x12c8, v0
|
|
|
|
; MUBUF-NEXT: v_mov_b32_e32 v13, 0x4000
|
2020-11-30 18:06:35 +01:00
|
|
|
; MUBUF-NEXT: buffer_load_dword v1, v1, s[0:3], 0 offen glc
|
2021-01-22 20:06:14 +01:00
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
2020-11-30 18:06:35 +01:00
|
|
|
; MUBUF-NEXT: v_mov_b32_e32 v12, 0
|
2021-01-22 20:06:14 +01:00
|
|
|
; MUBUF-NEXT: buffer_load_dword v0, v0, s[0:3], 0 offen glc
|
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
2020-11-30 18:06:35 +01:00
|
|
|
; MUBUF-NEXT: buffer_load_dword v8, v13, s[0:3], 0 offen glc
|
2021-01-22 20:06:14 +01:00
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; MUBUF-NEXT: v_mov_b32_e32 v13, 0x4000
|
2020-11-30 18:06:35 +01:00
|
|
|
; MUBUF-NEXT: buffer_load_dword v9, v13, s[0:3], 0 offen offset:4 glc
|
2021-01-22 20:06:14 +01:00
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; MUBUF-NEXT: v_mov_b32_e32 v13, 0x4000
|
|
|
|
; MUBUF-NEXT: buffer_load_dword v2, v13, s[0:3], 0 offen offset:8 glc
|
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; MUBUF-NEXT: v_mov_b32_e32 v13, 0x4000
|
2020-11-30 18:06:35 +01:00
|
|
|
; MUBUF-NEXT: buffer_load_dword v3, v13, s[0:3], 0 offen offset:12 glc
|
2021-01-22 20:06:14 +01:00
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; MUBUF-NEXT: v_mov_b32_e32 v13, 0x4000
|
|
|
|
; MUBUF-NEXT: buffer_load_dword v10, v13, s[0:3], 0 offen offset:16 glc
|
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; MUBUF-NEXT: v_mov_b32_e32 v13, 0x4000
|
|
|
|
; MUBUF-NEXT: buffer_load_dword v11, v13, s[0:3], 0 offen offset:20 glc
|
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; MUBUF-NEXT: v_add_co_u32_e32 v2, vcc, v0, v2
|
2020-11-30 18:06:35 +01:00
|
|
|
; MUBUF-NEXT: v_addc_co_u32_e32 v3, vcc, v1, v3, vcc
|
|
|
|
; MUBUF-NEXT: v_add_co_u32_e32 v0, vcc, v7, v8
|
|
|
|
; MUBUF-NEXT: v_addc_co_u32_e32 v1, vcc, v6, v9, vcc
|
2021-01-22 20:06:14 +01:00
|
|
|
; MUBUF-NEXT: v_add_co_u32_e32 v4, vcc, v4, v10
|
|
|
|
; MUBUF-NEXT: v_addc_co_u32_e32 v5, vcc, v5, v11, vcc
|
|
|
|
; MUBUF-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; MUBUF-NEXT: global_store_dwordx2 v12, v[4:5], s[4:5] offset:16
|
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; MUBUF-NEXT: global_store_dwordx4 v12, v[0:3], s[4:5]
|
|
|
|
; MUBUF-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; MUBUF-NEXT: s_endpgm
|
|
|
|
;
|
|
|
|
; FLATSCR-LABEL: local_stack_offset_uses_sp_flat:
|
|
|
|
; FLATSCR: ; %bb.0: ; %entry
|
|
|
|
; FLATSCR-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x0
|
|
|
|
; FLATSCR-NEXT: s_add_u32 flat_scratch_lo, s2, s5
|
|
|
|
; FLATSCR-NEXT: s_addc_u32 flat_scratch_hi, s3, 0
|
|
|
|
; FLATSCR-NEXT: s_add_u32 s2, 16, 0x4000
|
|
|
|
; FLATSCR-NEXT: v_mov_b32_e32 v0, 0
|
|
|
|
; FLATSCR-NEXT: s_movk_i32 vcc_hi, 0x2000
|
|
|
|
; FLATSCR-NEXT: s_mov_b32 s3, 0
|
|
|
|
; FLATSCR-NEXT: scratch_store_dword off, v0, vcc_hi
|
|
|
|
; FLATSCR-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; FLATSCR-NEXT: BB2_1: ; %loadstoreloop
|
|
|
|
; FLATSCR-NEXT: ; =>This Inner Loop Header: Depth=1
|
|
|
|
; FLATSCR-NEXT: s_add_u32 s4, 0x4000, s3
|
|
|
|
; FLATSCR-NEXT: s_add_i32 s3, s3, 1
|
|
|
|
; FLATSCR-NEXT: s_cmpk_lt_u32 s3, 0x2120
|
|
|
|
; FLATSCR-NEXT: scratch_store_byte off, v0, s4
|
|
|
|
; FLATSCR-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; FLATSCR-NEXT: s_cbranch_scc1 BB2_1
|
|
|
|
; FLATSCR-NEXT: ; %bb.2: ; %split
|
|
|
|
; FLATSCR-NEXT: s_movk_i32 s3, 0x1000
|
|
|
|
; FLATSCR-NEXT: s_add_u32 s3, 0x4000, s3
|
|
|
|
; FLATSCR-NEXT: scratch_load_dwordx2 v[8:9], off, s3 offset:720 glc
|
|
|
|
; FLATSCR-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; FLATSCR-NEXT: scratch_load_dwordx4 v[0:3], off, s3 offset:704 glc
|
|
|
|
; FLATSCR-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; FLATSCR-NEXT: scratch_load_dwordx2 v[10:11], off, s2 glc
|
|
|
|
; FLATSCR-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; FLATSCR-NEXT: scratch_load_dwordx4 v[4:7], off, s2 offset:-16 glc
|
|
|
|
; FLATSCR-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; FLATSCR-NEXT: v_mov_b32_e32 v12, 0
|
|
|
|
; FLATSCR-NEXT: v_add_co_u32_e32 v2, vcc, v2, v6
|
|
|
|
; FLATSCR-NEXT: v_addc_co_u32_e32 v3, vcc, v3, v7, vcc
|
|
|
|
; FLATSCR-NEXT: v_add_co_u32_e32 v0, vcc, v0, v4
|
|
|
|
; FLATSCR-NEXT: v_addc_co_u32_e32 v1, vcc, v1, v5, vcc
|
|
|
|
; FLATSCR-NEXT: v_add_co_u32_e32 v4, vcc, v8, v10
|
|
|
|
; FLATSCR-NEXT: v_addc_co_u32_e32 v5, vcc, v9, v11, vcc
|
|
|
|
; FLATSCR-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; FLATSCR-NEXT: global_store_dwordx2 v12, v[4:5], s[0:1] offset:16
|
|
|
|
; FLATSCR-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; FLATSCR-NEXT: global_store_dwordx4 v12, v[0:3], s[0:1]
|
|
|
|
; FLATSCR-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; FLATSCR-NEXT: s_endpgm
|
|
|
|
entry:
|
|
|
|
%pin.low = alloca i32, align 1024, addrspace(5)
|
|
|
|
%local.area = alloca [160 x <3 x i64>], align 8192, addrspace(5)
|
|
|
|
store volatile i32 0, i32 addrspace(5)* %pin.low
|
|
|
|
%local.area.cast = bitcast [160 x <3 x i64>] addrspace(5)* %local.area to i8 addrspace(5)*
|
|
|
|
call void @llvm.memset.p5i8.i32(i8 addrspace(5)* align 4 %local.area.cast, i8 0, i32 8480, i1 true)
|
|
|
|
%gep.large.offset = getelementptr inbounds [160 x <3 x i64>], [160 x <3 x i64>] addrspace(5)* %local.area, i64 0, i64 150
|
|
|
|
%gep.small.offset = getelementptr inbounds [160 x <3 x i64>], [160 x <3 x i64>] addrspace(5)* %local.area, i64 0, i64 0
|
|
|
|
%load0 = load volatile <3 x i64>, <3 x i64> addrspace(5)* %gep.large.offset
|
|
|
|
%load1 = load volatile <3 x i64>, <3 x i64> addrspace(5)* %gep.small.offset
|
|
|
|
%add0 = add <3 x i64> %load0, %load1
|
|
|
|
store volatile <3 x i64> %add0, <3 x i64> addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2020-09-10 19:06:12 +02:00
|
|
|
declare void @llvm.memset.p5i8.i32(i8 addrspace(5)* nocapture writeonly, i8, i32, i1 immarg) #0
|
|
|
|
|
|
|
|
attributes #0 = { argmemonly nounwind willreturn writeonly }
|