mirror of
https://github.com/RPCS3/llvm.git
synced 2025-05-23 22:06:19 +00:00

Summary: Attaching !absolute_symbol to a global variable does two things: 1) Marks it as an absolute symbol reference. 2) Specifies the value range of that symbol's address. Teach the X86 backend to allow absolute symbols to appear in place of immediates by extending the relocImm and mov64imm32 matchers. Start using relocImm in more places where it is legal. As previously proposed on llvm-dev: http://lists.llvm.org/pipermail/llvm-dev/2016-October/105800.html Differential Revision: https://reviews.llvm.org/D25878 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289087 91177308-0d34-0410-b5e6-96231b3b80d8
11 lines
181 B
LLVM
11 lines
181 B
LLVM
; RUN: opt -S -functionattrs %s | FileCheck %s
|
|
|
|
@a = external global i8, !absolute_symbol !0
|
|
|
|
; CHECK-NOT: define nonnull
|
|
define i8* @foo() {
|
|
ret i8* @a
|
|
}
|
|
|
|
!0 = !{i64 0, i64 256}
|