forked from OSchip/llvm-project
Optimize PIC implementation. GOTOFF can be used when the symbol is defined
and used in the same module. llvm-svn: 37044
This commit is contained in:
parent
3551928a2b
commit
d705f5d51d
|
@ -792,7 +792,7 @@ SDOperand ARMTargetLowering::LowerGlobalAddressELF(SDOperand Op,
|
|||
GlobalValue *GV = cast<GlobalAddressSDNode>(Op)->getGlobal();
|
||||
Reloc::Model RelocM = getTargetMachine().getRelocationModel();
|
||||
if (RelocM == Reloc::PIC_) {
|
||||
bool UseGOTOFF = GV->hasInternalLinkage();
|
||||
bool UseGOTOFF = !GV->isDeclaration();
|
||||
ARMConstantPoolValue *CPV =
|
||||
new ARMConstantPoolValue(GV, ARMCP::CPValue, UseGOTOFF ? "GOTOFF":"GOT");
|
||||
SDOperand CPAddr = DAG.getTargetConstantPool(CPV, PtrVT, 2);
|
||||
|
|
Loading…
Reference in New Issue