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

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri Mar 14 14:24:03 PDT 2014


On 14 March 2014 17:16, Weiming Zhao <weimingz at codeaurora.org> wrote:
> I just gave a try to MegeGlobal with alias because I thought it's easy to do. However, another issue with it is:
> Although I got aliases like:
> @h0 = alias getelementptr inbounds (... at _MergedGlobals, 0, 0)
> @h1 = alias getelementptr inbounds (... at _MergedGlobals, 0, 1)
> @h2 = alias getelementptr inbounds (... at _MergedGlobals, 0, 2)
>
> They cannot be lowered to correct asm. The all be aliases of _MergedGlobals:
>         .globl  h0
> .set h0, _MergedGlobals
>         .globl  h1
> .set h1, _MergedGlobals
>         .globl  h2
> .set h2, _MergedGlobals
>
> I guess there is no support in asm to alias to a member of struct, right?

More or less. You can use a constantexpr, but we wast to remove that
and replace it with an explicit offset. llvm.org/pr10367.

There could be bugs too, of course.

Cheers,
Rafael



More information about the llvm-dev mailing list