2019-09-05 08:34:01 +08:00
|
|
|
; RUN: llc -mtriple=amdgcn- -mcpu=tahiti -filetype=obj < %s | llvm-readobj -r --symbols | FileCheck %s -check-prefix=GCN
|
|
|
|
; RUN: llc -mtriple=amdgcn- -mcpu=tonga -filetype=obj < %s | llvm-readobj -r --symbols | FileCheck %s -check-prefix=GCN
|
|
|
|
; RUN: llc -mtriple=r600- -mcpu=cypress -filetype=obj < %s | llvm-readobj -r --symbols | FileCheck %s -check-prefix=EG
|
2014-06-14 12:26:05 +08:00
|
|
|
|
Partially revert D61491 "AMDGPU: Be explicit about whether the high-word in SI_PC_ADD_REL_OFFSET is 0"
Summary:
D61491 caused us to use relocs when they're not strictly necessary, to
refer to symbols in the text section. This is a pessimization and it's a
problem for some loaders that don't support relocs yet.
Reviewers: nhaehnle, arsenm, tpr
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65813
llvm-svn: 370667
2019-09-02 22:40:57 +08:00
|
|
|
; GCN: R_AMDGPU_GOTPCREL32_LO extern_const_addrspace 0x0
|
2016-06-26 02:24:16 +08:00
|
|
|
; EG: R_AMDGPU_ABS32 extern_const_addrspace
|
|
|
|
|
|
|
|
; CHECK-DAG: Name: extern_const_addrspace
|
2018-02-14 02:00:25 +08:00
|
|
|
@extern_const_addrspace = external unnamed_addr addrspace(4) constant [5 x i32], align 4
|
2014-06-14 12:26:05 +08:00
|
|
|
|
2016-06-26 02:24:16 +08:00
|
|
|
; CHECK-DAG: Name: load_extern_const_init
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @load_extern_const_init(i32 addrspace(1)* %out) nounwind {
|
2018-02-14 02:00:25 +08:00
|
|
|
%val = load i32, i32 addrspace(4)* getelementptr ([5 x i32], [5 x i32] addrspace(4)* @extern_const_addrspace, i64 0, i64 3), align 4
|
2014-06-14 12:26:05 +08:00
|
|
|
store i32 %val, i32 addrspace(1)* %out, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2016-06-26 02:24:16 +08:00
|
|
|
; CHECK-DAG: Name: undef_const_addrspace
|
2018-02-14 02:00:25 +08:00
|
|
|
@undef_const_addrspace = unnamed_addr addrspace(4) constant [5 x i32] undef, align 4
|
2014-06-14 12:26:05 +08:00
|
|
|
|
2016-06-26 02:24:16 +08:00
|
|
|
; CHECK-DAG: Name: undef_const_addrspace
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @load_undef_const_init(i32 addrspace(1)* %out) nounwind {
|
2018-02-14 02:00:25 +08:00
|
|
|
%val = load i32, i32 addrspace(4)* getelementptr ([5 x i32], [5 x i32] addrspace(4)* @undef_const_addrspace, i64 0, i64 3), align 4
|
2014-06-14 12:26:05 +08:00
|
|
|
store i32 %val, i32 addrspace(1)* %out, align 4
|
|
|
|
ret void
|
|
|
|
}
|