[llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp

Chris Lattner clattner at apple.com
Mon May 14 12:52:21 PDT 2007


> Optimize PIC implementation. GOTOFF can be used when the symbol is  
> defined
> and used in the same module.

Does this work for weak symbols?

-Chris

>
> ---
> Diffs of the changes:  (+1 -1)
>
>  ARMISelLowering.cpp |    2 +-
>  1 files changed, 1 insertion(+), 1 deletion(-)
>
>
> Index: llvm/lib/Target/ARM/ARMISelLowering.cpp
> diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.50 llvm/lib/ 
> Target/ARM/ARMISelLowering.cpp:1.51
> --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.50	Thu May  3  
> 19:26:58 2007
> +++ llvm/lib/Target/ARM/ARMISelLowering.cpp	Mon May 14 13:46:23 2007
> @@ -792,7 +792,7 @@
>    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);
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list