[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 12:12:16 PDT 2016


pcc added a comment.

> 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.)


http://reviews.llvm.org/D21883





More information about the llvm-commits mailing list