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

Tim Northover
Wed, 12 Mar 2014 19:49:35 -0000

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.