2018-11-15 10:32:43 +08:00
|
|
|
; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri -mattr=-code-object-v3 | FileCheck --check-prefix=HSA %s
|
|
|
|
; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri -mattr=-code-object-v3,-flat-for-global | FileCheck --check-prefix=HSA-CI %s
|
|
|
|
; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=carrizo -mattr=-code-object-v3 | FileCheck --check-prefix=HSA %s
|
|
|
|
; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=carrizo -mattr=-code-object-v3,-flat-for-global | FileCheck --check-prefix=HSA-VI %s
|
2019-06-21 00:29:40 +08:00
|
|
|
; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri -filetype=obj -mattr=-code-object-v3 | llvm-readobj -symbols -s -sd | FileCheck --check-prefix=ELF %s
|
|
|
|
; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri -mattr=-code-object-v3 | llvm-mc -filetype=obj -triple amdgcn--amdhsa -mcpu=kaveri -mattr=-code-object-v3 | llvm-readobj -symbols -s -sd | FileCheck %s --check-prefix=ELF
|
|
|
|
; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx1010 -mattr=+WavefrontSize32,-WavefrontSize64,-code-object-v3 | FileCheck --check-prefix=HSA --check-prefix=GFX10 --check-prefix=GFX10-W32 %s
|
|
|
|
; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx1010 -mattr=-WavefrontSize32,+WavefrontSize64,-code-object-v3 | FileCheck --check-prefix=HSA --check-prefix=GFX10 --check-prefix=GFX10-W64 %s
|
2015-06-27 05:15:07 +08:00
|
|
|
|
|
|
|
; The SHT_NOTE section contains the output from the .hsa_code_object_*
|
|
|
|
; directives.
|
|
|
|
|
2015-09-26 05:41:28 +08:00
|
|
|
; ELF: Section {
|
2016-05-06 01:03:33 +08:00
|
|
|
; ELF: Name: .text
|
2015-09-26 05:41:28 +08:00
|
|
|
; ELF: Type: SHT_PROGBITS (0x1)
|
2016-05-06 01:03:33 +08:00
|
|
|
; ELF: Flags [ (0x6)
|
2015-09-26 05:41:28 +08:00
|
|
|
; ELF: SHF_ALLOC (0x2)
|
|
|
|
; ELF: SHF_EXECINSTR (0x4)
|
|
|
|
; ELF: }
|
|
|
|
|
2015-06-27 05:15:07 +08:00
|
|
|
; ELF: SHT_NOTE
|
2020-02-22 07:26:51 +08:00
|
|
|
; ELF: Flags [ (0x2)
|
|
|
|
; ELF: SHF_ALLOC (0x2)
|
2016-10-18 06:40:15 +08:00
|
|
|
; ELF: ]
|
|
|
|
; ELF: SectionData (
|
2015-06-27 05:15:07 +08:00
|
|
|
; ELF: 0000: 04000000 08000000 01000000 414D4400
|
2016-07-13 22:23:33 +08:00
|
|
|
; ELF: 0010: 02000000 01000000 04000000 1B000000
|
2015-06-27 05:15:07 +08:00
|
|
|
; ELF: 0020: 03000000 414D4400 04000700 07000000
|
|
|
|
; ELF: 0030: 00000000 00000000 414D4400 414D4447
|
|
|
|
; ELF: 0040: 50550000
|
2016-10-18 06:40:15 +08:00
|
|
|
; ELF: )
|
2015-06-27 05:15:07 +08:00
|
|
|
|
2015-11-06 19:45:14 +08:00
|
|
|
; ELF: Symbol {
|
|
|
|
; ELF: Name: simple
|
2016-02-12 14:31:30 +08:00
|
|
|
; ELF: Size: 288
|
2015-11-06 19:45:14 +08:00
|
|
|
; ELF: Type: AMDGPU_HSA_KERNEL (0xA)
|
|
|
|
; ELF: }
|
|
|
|
|
2017-01-07 01:02:10 +08:00
|
|
|
; HSA-NOT: .AMDGPU.config
|
|
|
|
; HSA: .text
|
2016-07-13 22:23:33 +08:00
|
|
|
; HSA: .hsa_code_object_version 2,1
|
2015-06-27 05:58:42 +08:00
|
|
|
; HSA-CI: .hsa_code_object_isa 7,0,0,"AMD","AMDGPU"
|
|
|
|
; HSA-VI: .hsa_code_object_isa 8,0,1,"AMD","AMDGPU"
|
2014-12-03 01:05:41 +08:00
|
|
|
|
2017-07-14 08:11:13 +08:00
|
|
|
; HSA-LABEL: .amdgpu_hsa_kernel simple
|
2015-06-27 05:14:58 +08:00
|
|
|
; HSA: {{^}}simple:
|
2015-06-27 05:58:31 +08:00
|
|
|
; HSA: .amd_kernel_code_t
|
2015-12-01 05:16:03 +08:00
|
|
|
; HSA: enable_sgpr_private_segment_buffer = 1
|
|
|
|
; HSA: enable_sgpr_kernarg_segment_ptr = 1
|
2019-06-21 00:29:40 +08:00
|
|
|
|
|
|
|
; PRE-GFX10: enable_wavefront_size32 = 0
|
|
|
|
; GFX10-W32: enable_wavefront_size32 = 1
|
|
|
|
; GFX10-W64: enable_wavefront_size32 = 0
|
|
|
|
|
|
|
|
; PRE-GFX10: wavefront_size = 6
|
|
|
|
; GFX10-W32: wavefront_size = 5
|
|
|
|
; GFX10-W64: wavefront_size = 6
|
|
|
|
|
2017-01-26 04:21:57 +08:00
|
|
|
; HSA: call_convention = -1
|
2015-06-27 05:58:31 +08:00
|
|
|
; HSA: .end_amd_kernel_code_t
|
2015-12-01 05:16:03 +08:00
|
|
|
; HSA: s_load_dwordx2 s[{{[0-9]+:[0-9]+}}], s[4:5], 0x0
|
2015-06-27 05:58:42 +08:00
|
|
|
|
2014-12-03 01:05:41 +08:00
|
|
|
; Make sure we are setting the ATC bit:
|
2015-06-27 05:58:42 +08:00
|
|
|
; HSA-CI: s_mov_b32 s[[HI:[0-9]]], 0x100f000
|
|
|
|
; On VI+ we also need to set MTYPE = 2
|
|
|
|
; HSA-VI: s_mov_b32 s[[HI:[0-9]]], 0x1100f000
|
2015-12-23 04:55:23 +08:00
|
|
|
; Make sure we generate flat store for HSA
|
2019-06-21 00:29:40 +08:00
|
|
|
; PRE-GFX10: flat_store_dword v{{\[[0-9]+:[0-9]+\]}}, v{{[0-9]+}}
|
|
|
|
; GFX10: global_store_dword v{{\[[0-9]+:[0-9]+\]}}, v{{[0-9]+}}
|
2014-12-03 01:05:41 +08:00
|
|
|
|
2016-01-08 22:50:23 +08:00
|
|
|
; HSA: .Lfunc_end0:
|
|
|
|
; HSA: .size simple, .Lfunc_end0-simple
|
|
|
|
|
2016-05-06 17:07:29 +08:00
|
|
|
define amdgpu_kernel void @simple(i32 addrspace(1)* %out) {
|
2014-12-03 01:05:41 +08:00
|
|
|
entry:
|
|
|
|
store i32 0, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
2017-07-14 08:11:13 +08:00
|
|
|
|
|
|
|
; HSA-LABEL: .amdgpu_hsa_kernel simple_no_kernargs
|
|
|
|
; HSA: enable_sgpr_kernarg_segment_ptr = 0
|
|
|
|
define amdgpu_kernel void @simple_no_kernargs() {
|
|
|
|
entry:
|
|
|
|
store volatile i32 0, i32 addrspace(1)* undef
|
|
|
|
ret void
|
|
|
|
}
|