[llvm] r271066 - Start using shouldAssumeDSOLocal on ARM.
Rafael EspĂndola via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 24 12:11:03 PDT 2016
r279655.
Cheers,
Rafael
On 24 August 2016 at 14:37, Steven Wu <stevenwu at apple.com> wrote:
> Thanks!
>
> On Aug 24, 2016, at 11:20 AM, Rafael EspĂndola <rafael.espindola at gmail.com>
> wrote:
>
> It should be checking the file format. I will fix that after lunch. Thanks.
>
>
> On Aug 24, 2016 1:52 PM, "Steven Wu" <stevenwu at apple.com> wrote:
>
> Hi Rafael
>
> I run into a problem for this commit. See comment below.
>
>> On May 27, 2016, at 3:41 PM, Rafael Espindola via llvm-commits
>> <llvm-commits at lists.llvm.org> wrote:
>>
>> Author: rafael
>> Date: Fri May 27 17:41:51 2016
>> New Revision: 271066
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=271066&view=rev
>> Log:
>> Start using shouldAssumeDSOLocal on ARM.
>>
>> Given where this is used it should be a nop.
>>
>> Modified:
>> llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp
>>
>> Modified: llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp?rev=271066&r1=271065&r2=271066&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp (original)
>> +++ llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp Fri May 27 17:41:51 2016
>> @@ -22,6 +22,7 @@
>> #include "Thumb1FrameLowering.h"
>> #include "Thumb1InstrInfo.h"
>> #include "Thumb2InstrInfo.h"
>> +#include "llvm/CodeGen/Analysis.h"
>> #include "llvm/CodeGen/MachineRegisterInfo.h"
>> #include "llvm/IR/Attributes.h"
>> #include "llvm/IR/Function.h"
>> @@ -273,40 +274,19 @@ bool ARMSubtarget::isAAPCS16_ABI() const
>> return TM.TargetABI == ARMBaseTargetMachine::ARM_ABI_AAPCS16;
>> }
>>
>> -
>> -/// GVIsIndirectSymbol - true if the GV will be accessed via an indirect
>> symbol.
>> +/// true if the GV will be accessed via an indirect symbol.
>> bool
>> ARMSubtarget::GVIsIndirectSymbol(const GlobalValue *GV,
>> Reloc::Model RelocM) const {
>> - if (RelocM == Reloc::Static)
>> - return false;
>> -
>> - bool isDef = GV->isStrongDefinitionForLinker();
>> + if (!shouldAssumeDSOLocal(RelocM, TargetTriple, *GV->getParent(), GV))
>> + return true;
>>
>> - if (!isTargetMachO()) {
>> - // Extra load is needed for all externally visible.
>> - if (GV->hasLocalLinkage() || GV->hasHiddenVisibility())
>> - return false;
>> + // 32 bit macho has no relocation for a-b if a is undefined, even if b
>> is in
>> + // the section that is being relocated. This means we have to use o
>> load even
>> + // for GVs that are known to be local to the dso.
>> + if (isTargetDarwin() && RelocM == Reloc::PIC_ &&
>> + (GV->isDeclarationForLinker() || GV->hasCommonLinkage()))
> Is there any specific reason using isTargetDarwin() instead of
> isTargetMachO()? This seems like a general limitation for MachO which is not
> specific to Darwin. When I compiling embedded architecture for MachO
> (armv7em), my target is not Darwin but it is still MachO (default triple is
> thumbv7em-apple-unknown-macho). I will get error like:
> fatal error: error in backend: symbol '*' can not be undefined in a
> subtraction expression
>
> Thanks
>
> Steven
>
>> return true;
>> - } else {
>> - // If this is a strong reference to a definition, it is definitely
>> not
>> - // through a stub.
>> - if (isDef)
>> - return false;
>> -
>> - // Unless we have a symbol with hidden visibility, we have to go
>> through a
>> - // normal $non_lazy_ptr stub because this symbol might be resolved
>> late.
>> - if (!GV->hasHiddenVisibility()) // Non-hidden $non_lazy_ptr
>> reference.
>> - return true;
>> -
>> - if (RelocM == Reloc::PIC_) {
>> - // If symbol visibility is hidden, we have a stub for common symbol
>> - // references and external declarations.
>> - if (GV->isDeclarationForLinker() || GV->hasCommonLinkage())
>> - // Hidden $non_lazy_ptr reference.
>> - return true;
>> - }
>> - }
>>
>> return false;
>> }
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
>
More information about the llvm-commits
mailing list