[PATCH] D21883: ThinLTO: Do not take into account whether a definition has multiple copies when promoting.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 30 17:35:52 PDT 2016


pcc added a comment.

> Do we have a test case for the single copy non-exported case to ensure that we end up with the same internalized linkage with this change? If not, please add one.


Please see http://reviews.llvm.org/D21915.

In http://reviews.llvm.org/D21883#471613, @pcc wrote:

> > We intentionally don't promote linkonce to weak when possible because linkonce -> weak promotion inhibit auto-hidden on MachO.
>
> >  I should look at it again with the recent local_unnamed_addr attribute to understand exactly where we stand now and how this could affect our codegen.
>
>
> Sorry if I wasn't clear enough, but I believe this to be NFC in the case where the client applies both promotion and internalization to the index. I believe that in every case where I changed linkonce to weak in a test case, the internalize phase would change linkage to internal. We were already upgrading exported symbols from linkonce to weak, see the code I deleted in thinLTOResolveWeakForLinkerGUID. If we do want to apply auto-hidden to these decls, we should probably think about that separately.
>
> (IMHO, the fact that we apply promotion and internalization to the index separately is very confusing, and we should fix that at some point.)


The test cases I added in http://reviews.llvm.org/D21915 should help show that this is NFC.


http://reviews.llvm.org/D21883





More information about the llvm-commits mailing list