llvm.org GIT mirror llvm / 0be7d0c
AMDPGU/SI: Use correct resource descriptors for VI on HSA Summary: We need to set MTYPE = 2 for VI shaders when targeting the HSA runtime. Reviewers: arsenm Differential Revision: http://reviews.llvm.org/D10777 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240841 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 4 years ago
2 changed file(s) with 14 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
27192719
27202720 uint64_t SIInstrInfo::getDefaultRsrcDataFormat() const {
27212721 uint64_t RsrcDataFormat = AMDGPU::RSRC_DATA_FORMAT;
2722 if (ST.isAmdHsaOS())
2722 if (ST.isAmdHsaOS()) {
27232723 RsrcDataFormat |= (1ULL << 56);
27242724
2725 if (ST.getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS)
2726 // Set MTYPE = 2
2727 RsrcDataFormat |= (2ULL << 59);
2728 }
2729
27252730 return RsrcDataFormat;
27262731 }
None ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri | FileCheck --check-prefix=HSA %s
0 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri | FileCheck --check-prefix=HSA-CI --check-prefix=HSA %s
1 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=carrizo | FileCheck --check-prefix=HSA-VI --check-prefix=HSA %s
12 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri -filetype=obj | llvm-readobj -s -sd | FileCheck --check-prefix=ELF %s
23 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri | llvm-mc -filetype=obj -triple amdgcn--amdhsa -mcpu=kaveri | llvm-readobj -s -sd | FileCheck %s --check-prefix=ELF
34
1213 ; ELF: 0040: 50550000
1314
1415 ; HSA: .hsa_code_object_version 1,0
15 ; HSA: .hsa_code_object_isa 7,0,0,"AMD","AMDGPU"
16 ; HSA-CI: .hsa_code_object_isa 7,0,0,"AMD","AMDGPU"
17 ; HSA-VI: .hsa_code_object_isa 8,0,1,"AMD","AMDGPU"
1618
1719 ; HSA: {{^}}simple:
1820 ; HSA: .amd_kernel_code_t
1921 ; HSA: .end_amd_kernel_code_t
2022 ; HSA: s_load_dwordx2 s[{{[0-9]+:[0-9]+}}], s[0:1], 0x0
23
2124 ; Make sure we are setting the ATC bit:
22 ; HSA: s_mov_b32 s[[HI:[0-9]]], 0x100f000
25 ; HSA-CI: s_mov_b32 s[[HI:[0-9]]], 0x100f000
26 ; On VI+ we also need to set MTYPE = 2
27 ; HSA-VI: s_mov_b32 s[[HI:[0-9]]], 0x1100f000
2328 ; HSA: buffer_store_dword v{{[0-9]+}}, s[0:[[HI]]], 0
2429
2530 define void @simple(i32 addrspace(1)* %out) {