[llvm-dev] ThinLTO and linkonce_odr + unnamed_addr

Rafael Avila de Espindola via llvm-dev llvm-dev at lists.llvm.org
Fri Feb 9 11:44:41 PST 2018


Reid Kleckner <rnk at google.com> writes:

> There should be no semantic difference between linkonce_odr and weak_odr,
> except that weak_odr is non-discardable. Why doesn't the autohide
> optimization work just as well on weak_odr + unnamed_addr as linkonce_odr +
> unnamed_addr?

Because we can hide a symbol only when we could have dropped it. A user
of a library can have a undefined symbol to a weak_odr in that library,
but not to a linkonce_odr in that library.

Cheers,
Rafael


More information about the llvm-dev mailing list