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:
Lauro Ramos Venancio 2007-05-14 18:46:23 +00:00
parent 3551928a2b
commit d705f5d51d
1 changed files with 1 additions and 1 deletions

View File

@ -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);