[LLVMdev] [RFC] Section Declarations in LLVM IR

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue May 6 11:18:25 PDT 2014


>> My current idea for global alias is to split GlobalValue into
>> GlobalName (or GlobalAddress?) and GlobalValue. GlobalAlias would
>> inherit from GlobalName and not have a alignment or section of its
>> own. With that than it becomes easy to say that a GlobalAlias is just
>> an offset into a GlobalValue with some different information (linkage,
>> visibility, etc).
>
>
> I'm worried that optimizations won't know about the offset portion of an
> alias.  Do you think it's worth having something like a GlobalOffset that is
> equivalent to an alias with an offset?  If we add an offset to GlobalAlias,
> most optimizations won't know about it and will have bugs.  On the other
> hand, it's nice to have fewer IL constructs.

That is an interesting idea. I guess we could make it a C++ level
thing only. At the IR level it would still be just an alias, but when
reading it in we could create a different c++ type to easy the
transition. I am not sure if it needed or not right now, I will
probably give it a try and see.

Cheers,
Rafael



More information about the llvm-dev mailing list