2016-07-01 12:00:58 +02:00
|
|
|
; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri | FileCheck --check-prefix=HSA %s
|
2017-07-26 22:39:42 +02:00
|
|
|
; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri | FileCheck --check-prefix=HSA-CI %s
|
2016-07-01 12:00:58 +02:00
|
|
|
; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=carrizo | FileCheck --check-prefix=HSA %s
|
2017-07-26 22:39:42 +02:00
|
|
|
; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=carrizo | FileCheck --check-prefix=HSA-VI %s
|
2016-07-01 12:00:58 +02:00
|
|
|
; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri -filetype=obj | llvm-readobj -symbols -s -sd | FileCheck --check-prefix=ELF %s
|
|
|
|
; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri | llvm-mc -filetype=obj -triple amdgcn--amdhsa -mcpu=kaveri | llvm-readobj -symbols -s -sd | FileCheck %s --check-prefix=ELF
|
|
|
|
|
|
|
|
; The SHT_NOTE section contains the output from the .hsa_code_object_*
|
|
|
|
; directives.
|
|
|
|
|
|
|
|
; ELF: Section {
|
|
|
|
; ELF: Name: .text
|
|
|
|
; ELF: Type: SHT_PROGBITS (0x1)
|
|
|
|
; ELF: Flags [ (0x6)
|
|
|
|
; ELF: SHF_ALLOC (0x2)
|
|
|
|
; ELF: SHF_EXECINSTR (0x4)
|
2017-04-19 19:42:39 +02:00
|
|
|
; ELF: AddressAlignment: 4
|
2016-07-01 12:00:58 +02:00
|
|
|
; ELF: }
|
|
|
|
|
|
|
|
; ELF: SHT_NOTE
|
|
|
|
; ELF: 0000: 04000000 08000000 01000000 414D4400
|
2016-07-13 16:23:33 +02:00
|
|
|
; ELF: 0010: 02000000 01000000 04000000 1B000000
|
2016-07-01 12:00:58 +02:00
|
|
|
|
|
|
|
; ELF: 0020: 03000000 414D4400 04000700 07000000
|
|
|
|
; ELF: 0030: 00000000 00000000 414D4400 414D4447
|
|
|
|
; ELF: 0040: 50550000
|
|
|
|
|
|
|
|
; ELF: Symbol {
|
|
|
|
; ELF: Name: simple
|
2017-07-26 22:39:42 +02:00
|
|
|
; ELF: Size: 36
|
2016-07-01 12:00:58 +02:00
|
|
|
; ELF: Type: Function (0x2)
|
|
|
|
; ELF: }
|
|
|
|
|
2017-01-06 18:02:10 +01:00
|
|
|
; HSA: .text
|
2016-07-13 16:23:33 +02:00
|
|
|
; HSA: .hsa_code_object_version 2,1
|
2016-07-01 12:00:58 +02:00
|
|
|
; HSA-CI: .hsa_code_object_isa 7,0,0,"AMD","AMDGPU"
|
|
|
|
; HSA-VI: .hsa_code_object_isa 8,0,1,"AMD","AMDGPU"
|
|
|
|
|
|
|
|
; HSA-NOT: .amdgpu_hsa_kernel simple
|
2017-04-19 19:42:39 +02:00
|
|
|
; HSA: .globl simple
|
|
|
|
; HSA: .p2align 2
|
2016-07-01 12:00:58 +02:00
|
|
|
; HSA: {{^}}simple:
|
2017-04-19 21:38:10 +02:00
|
|
|
; HSA-NOT: amd_kernel_code_t
|
2017-07-26 22:39:42 +02:00
|
|
|
; HSA: flat_load_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, v[0:1]
|
2016-07-01 12:00:58 +02:00
|
|
|
|
|
|
|
; Make sure we are setting the ATC bit:
|
|
|
|
; Make sure we generate flat store for HSA
|
|
|
|
; HSA: flat_store_dword v{{\[[0-9]+:[0-9]+\]}}, v{{[0-9]+}}
|
|
|
|
|
|
|
|
; HSA: .Lfunc_end0:
|
|
|
|
; HSA: .size simple, .Lfunc_end0-simple
|
2017-04-19 21:38:10 +02:00
|
|
|
; HSA: ; Function info:
|
|
|
|
; HSA-NOT: COMPUTE_PGM_RSRC2
|
2017-05-17 23:56:25 +02:00
|
|
|
define void @simple(i32 addrspace(1)* addrspace(2)* %ptr.out) {
|
2016-07-01 12:00:58 +02:00
|
|
|
entry:
|
2017-05-17 23:56:25 +02:00
|
|
|
%out = load i32 addrspace(1)*, i32 addrspace(1)* addrspace(2)* %ptr.out
|
2016-07-01 12:00:58 +02:00
|
|
|
store i32 0, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
2017-04-19 19:42:39 +02:00
|
|
|
|
|
|
|
; Ignore explicit alignment that is too low.
|
|
|
|
; HSA: .globl simple_align2
|
|
|
|
; HSA: .p2align 2
|
|
|
|
define void @simple_align2(i32 addrspace(1)* addrspace(2)* %ptr.out) align 2 {
|
|
|
|
entry:
|
|
|
|
%out = load i32 addrspace(1)*, i32 addrspace(1)* addrspace(2)* %ptr.out
|
|
|
|
store i32 0, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|