1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

Use shouldAssumeDSOLocal.

With this ARM fast isel knows that PIE variable are not preemptable.

llvm-svn: 273169
This commit is contained in:
Rafael Espindola 2016-06-20 17:45:33 +00:00
parent 49873ba9d6
commit 5a790c1a6d
2 changed files with 22 additions and 1 deletions

View File

@ -2967,8 +2967,10 @@ bool ARMFastISel::tryToFoldLoadIntoMI(MachineInstr *MI, unsigned OpNo,
unsigned ARMFastISel::ARMLowerPICELF(const GlobalValue *GV,
unsigned Align, MVT VT) {
Reloc::Model RM = TM.getRelocationModel();
const Triple &TargetTriple = TM.getTargetTriple();
bool UseGOT_PREL =
!(GV->hasHiddenVisibility() || GV->hasLocalLinkage());
!shouldAssumeDSOLocal(RM, TargetTriple, *GV->getParent(), GV);
LLVMContext *Context = &MF->getFunction()->getContext();
unsigned ARMPCLabelIndex = AFI->createPICLabelUId();

View File

@ -0,0 +1,19 @@
; RUN: llc < %s -O0 -fast-isel-abort=1 -relocation-model=pic -mtriple=armv7-pc-linux-gnueabi | FileCheck %s
@var = global i32 42
define i32* @foo() {
; CHECK: foo:
; CHECK: ldr r0, .L[[POOL:.*]]
; CHECK-NEXT: .L[[ADDR:.*]]:
; CHECK-NEXT: add r0, pc, r0
; CHECK-NEXT: bx lr
; CHECK: .L[[POOL]]:
; CHECK-NEXT: .long var-(.L[[ADDR]]+8)
ret i32* @var
}
!llvm.module.flags = !{!0}
!0 = !{i32 1, !"PIE Level", i32 2}