[LLVMdev] [ARM] [PIC] optimizing the loading of hidden global variable

Weiming Zhao weimingz at codeaurora.org
Wed Mar 12 13:54:59 PDT 2014


Hi Tim,

Thanks for the pointer. It seems GlobalMerge only considers static/local GVs:
  if (!I->hasLocalLinkage() || I->isThreadLocal() || I->hasSection())
      continue;
Let me try some experiments in GlobalMerge.

Another place might be in ARMISelLowering.cpp :: LowerGlobalAddressELF(), but I think changing GlobalMerge makes more sense.

Thanks,
Weiming

Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation


-----Original Message-----
From: Tim Northover [mailto:t.p.northover at gmail.com] 
Sent: Wednesday, March 12, 2014 12:50 PM
To: Weiming Zhao
Cc: LLVM Developers Mailing List
Subject: Re: [LLVMdev] [ARM] [PIC] optimizing the loading of hidden global variable

Hi Weiming,

On 12 March 2014 17:43, Weiming Zhao <weimingz at codeaurora.org> wrote:
> Clang will emit 1 GOT entry for each GV and 2 instructions to get the
> address:
>
> GCC  does this only for the first GV. The rest GV address are computed
> directly:

This looks like it would be the job of lib/Transforms/GlobalMerge.cpp.
It looks like ARM runs it in all cases, perhaps it doesn't understand some ELF linkage subtleties?

Cheers.

Tim.





More information about the llvm-dev mailing list