[LLVMdev] [Propose] Add address-taken bit to GlobalVariable for disambiguation purpose

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Nov 5 08:36:08 PST 2013


>       o. The address-taken information collected before LTO (aka pre-IPO),
>          cannot be fed to LTO, unless we re-analyze them from ground up.

This is the one case I can think an attribute similar to this could
make a reasonable difference. Not because we get variables with too
many uses, but because we have to read in all the IL to find the uses.

I say similar because the semantics would have to be a bit different.
What we would want is basically a conservative cache of
GlobalStatus.IsCompared:

* If a GlobalValue has its address used in this TU, this flag must be clear.
* If a GlobalValue's address is not used in this TU, this flag may be set.

Note in particular that this is a per TU property. This means that its
users have to check the linkage (as they do when using GlobalStatus)
and the linker has to learn how merge them.

In summary, it is strictly just a compile time optimization.

Cheers,
Rafael



More information about the llvm-dev mailing list