2016-06-11 03:26:38 +08:00
|
|
|
; RUN: llc -march=amdgcn -mcpu=bonaire -show-mc-encoding < %s | FileCheck -check-prefix=GCN -check-prefix=CI -check-prefix=ALL %s
|
|
|
|
; RUN: llc -march=amdgcn -mcpu=carrizo --show-mc-encoding < %s | FileCheck -check-prefix=GCN -check-prefix=VI -check-prefix=ALL %s
|
2017-03-22 01:00:39 +08:00
|
|
|
; RUN: llc -march=amdgcn -mcpu=gfx900 --show-mc-encoding < %s | FileCheck -check-prefix=GCN -check-prefix=GFX9 -check-prefix=ALL %s
|
2018-11-15 10:32:43 +08:00
|
|
|
; RUN: llc -march=amdgcn -mcpu=bonaire -mtriple=amdgcn-unknown-amdhsa -mattr=-code-object-v3 < %s -mattr=-flat-for-global | FileCheck -check-prefix=GCNHSA -check-prefix=CIHSA -check-prefix=ALL %s
|
|
|
|
; RUN: llc -march=amdgcn -mcpu=carrizo -mtriple=amdgcn-unknown-amdhsa -mattr=-code-object-v3,-flat-for-global < %s | FileCheck -check-prefix=GCNHSA -check-prefix=VIHSA -check-prefix=ALL %s
|
2019-05-14 03:30:06 +08:00
|
|
|
; RUN: llc -march=amdgcn -mcpu=gfx1010 -mtriple=amdgcn-unknown-amdhsa -mattr=-code-object-v3,-flat-for-global < %s | FileCheck -check-prefix=GCNHSA -check-prefix=GFX10HSA -check-prefix=ALL %s
|
2015-12-01 05:15:53 +08:00
|
|
|
|
|
|
|
; FIXME: align on alloca seems to be ignored for private_segment_alignment
|
|
|
|
|
|
|
|
; ALL-LABEL: {{^}}large_alloca_compute_shader:
|
|
|
|
|
2016-05-11 08:28:54 +08:00
|
|
|
; GCN-DAG: s_mov_b32 s{{[0-9]+}}, SCRATCH_RSRC_DWORD0
|
2016-06-21 00:59:44 +08:00
|
|
|
; GCN-DAG: ; fixup A - offset: 4, value: SCRATCH_RSRC_DWORD0
|
2016-05-11 08:28:54 +08:00
|
|
|
; GCN-DAG: s_mov_b32 s{{[0-9]+}}, SCRATCH_RSRC_DWORD1
|
2016-06-21 00:59:44 +08:00
|
|
|
; GCN-DAG: ; fixup A - offset: 4, value: SCRATCH_RSRC_DWORD1
|
2016-05-11 08:28:54 +08:00
|
|
|
; GCN-DAG: s_mov_b32 s{{[0-9]+}}, -1
|
2016-06-14 00:05:57 +08:00
|
|
|
; CI-DAG: s_mov_b32 s{{[0-9]+}}, 0xe8f000
|
|
|
|
; VI-DAG: s_mov_b32 s{{[0-9]+}}, 0xe80000
|
2017-03-22 01:00:39 +08:00
|
|
|
; GFX9-DAG: s_mov_b32 s{{[0-9]+}}, 0xe00000
|
2015-12-01 05:15:53 +08:00
|
|
|
|
|
|
|
|
|
|
|
; GCNHSA: .amd_kernel_code_t
|
2015-12-01 05:16:03 +08:00
|
|
|
|
2016-09-09 18:08:02 +08:00
|
|
|
; GCNHSA: enable_sgpr_private_segment_wave_byte_offset = 1
|
|
|
|
; GCNHSA: user_sgpr_count = 8
|
|
|
|
; GCNHSA: enable_sgpr_workgroup_id_x = 1
|
|
|
|
; GCNHSA: enable_sgpr_workgroup_id_y = 0
|
|
|
|
; GCNHSA: enable_sgpr_workgroup_id_z = 0
|
|
|
|
; GCNHSA: enable_sgpr_workgroup_info = 0
|
|
|
|
; GCNHSA: enable_vgpr_workitem_id = 0
|
2015-12-01 05:16:03 +08:00
|
|
|
|
|
|
|
; GCNHSA: enable_sgpr_private_segment_buffer = 1
|
|
|
|
; GCNHSA: enable_sgpr_dispatch_ptr = 0
|
|
|
|
; GCNHSA: enable_sgpr_queue_ptr = 0
|
|
|
|
; GCNHSA: enable_sgpr_kernarg_segment_ptr = 1
|
|
|
|
; GCNHSA: enable_sgpr_dispatch_id = 0
|
2016-02-12 14:31:30 +08:00
|
|
|
; GCNHSA: enable_sgpr_flat_scratch_init = 1
|
2015-12-01 05:16:03 +08:00
|
|
|
; GCNHSA: enable_sgpr_private_segment_size = 0
|
|
|
|
; GCNHSA: enable_sgpr_grid_workgroup_count_x = 0
|
|
|
|
; GCNHSA: enable_sgpr_grid_workgroup_count_y = 0
|
|
|
|
; GCNHSA: enable_sgpr_grid_workgroup_count_z = 0
|
2015-12-16 06:55:30 +08:00
|
|
|
; GCNHSA: workitem_private_segment_byte_size = 32772
|
2015-12-01 05:15:53 +08:00
|
|
|
; GCNHSA: private_segment_alignment = 4
|
|
|
|
; GCNHSA: .end_amd_kernel_code_t
|
|
|
|
|
2019-05-14 03:30:06 +08:00
|
|
|
; GFX10HSA: s_add_u32 [[FLAT_SCR_LO:s[0-9]+]], s{{[0-9]+}}, s{{[0-9]+}}
|
|
|
|
; GFX10HSA-DAG: s_addc_u32 [[FLAT_SCR_HI:s[0-9]+]], s{{[0-9]+}}, 0
|
|
|
|
; GFX10HSA-DAG: s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), [[FLAT_SCR_LO]]
|
|
|
|
; GFX10HSA-DAG: s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), [[FLAT_SCR_HI]]
|
2015-12-01 05:15:53 +08:00
|
|
|
|
2016-02-12 14:31:30 +08:00
|
|
|
; GCNHSA: buffer_store_dword {{v[0-9]+}}, {{v[0-9]+}}, s[0:3], s9 offen
|
|
|
|
; GCNHSA: buffer_load_dword {{v[0-9]+}}, {{v[0-9]+}}, s[0:3], s9 offen
|
2015-12-01 05:15:53 +08:00
|
|
|
|
2018-02-03 00:07:16 +08:00
|
|
|
; Scratch size = alloca size + emergency stack slot, align {{.*}}, addrspace(5)
|
2015-12-01 05:15:53 +08:00
|
|
|
; ALL: ; ScratchSize: 32772
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @large_alloca_compute_shader(i32 %x, i32 %y) #0 {
|
2018-02-03 00:07:16 +08:00
|
|
|
%large = alloca [8192 x i32], align 4, addrspace(5)
|
|
|
|
%gep = getelementptr [8192 x i32], [8192 x i32] addrspace(5)* %large, i32 0, i32 8191
|
|
|
|
store volatile i32 %x, i32 addrspace(5)* %gep
|
|
|
|
%gep1 = getelementptr [8192 x i32], [8192 x i32] addrspace(5)* %large, i32 0, i32 %y
|
|
|
|
%val = load volatile i32, i32 addrspace(5)* %gep1
|
2015-12-01 05:15:53 +08:00
|
|
|
store volatile i32 %val, i32 addrspace(1)* undef
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
attributes #0 = { nounwind }
|