mirror of
https://github.com/RPCS3/llvm.git
synced 2025-05-14 17:36:29 +00:00

Summary: When compiling with -fpic, in contrast to -fPIC, use only the immediate field to index into the GOT. This saves space if the GOT is known to be small. The linker will warn if the GOT is too large for this method. Reviewers: jyknight, venkatra Reviewed By: jyknight Subscribers: brad, fedor.sergeev, jrtc27, llvm-commits Differential Revision: https://reviews.llvm.org/D47136 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334383 91177308-0d34-0410-b5e6-96231b3b80d8
15 lines
276 B
LLVM
15 lines
276 B
LLVM
; RUN: llc < %s -relocation-model=pic -mtriple=sparc | FileCheck %s
|
|
|
|
@value = external global i32
|
|
|
|
define i32 @test() nounwind {
|
|
; CHECK: ld [%i0+value], %i0
|
|
entry:
|
|
%0 = load i32, i32* @value
|
|
ret i32 %0
|
|
}
|
|
|
|
!llvm.module.flags = !{!0}
|
|
|
|
!0 = !{i32 7, !"PIC Level", i32 1}
|