[llvm-commits] [patch][8927] Add an unnamed_addr attribute

Nick Lewycky nicholas at mxc.ca
Sun Jan 9 18:37:41 PST 2011


Rafael Ávila de Espíndola wrote:
> This is the first step in fixing PR8927:
>
> The attached patch adds a unnamed_addr bit to global constants and
> functions. This will be used to indicate that the address is not
> significant and therefore the constant or function can be merged with
> others.
>
> If an optimization pass can show that an address is not used, it can set
> this.
>
> Examples of things that can have this set by the FE are globals created
> to hold string literals and C++ constructors.
>
> Aliases and non constant globals are not allowed to have unnamed_addr
> since I couldn't figure out any use for it.
>
> Comments?

Silly idea, but we already have the concept of names in the IR. Why not 
just make these anonymous?

If you think that IR names shouldn't change semantics, consider that the 
verifier already rejects global aliases without names.

Nick



More information about the llvm-commits mailing list