[PATCH] D43690: [ThinLTO] Keep available_externally symbols live
Peter Collingbourne via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 5 13:46:53 PST 2018
pcc added inline comments.
================
Comment at: lib/Transforms/IPO/FunctionImport.cpp:620
+ for (auto &S : VI.getSummaryList())
+ if (S->linkage() != GlobalValue::AvailableExternallyLinkage)
+ return;
----------------
tejohnson wrote:
> Is it possible to have a symbol that is weak in one module and available_externally in another? If so, it would be more correct to return only if none of the copies is available_externally.
I suppose so. In the situation where we have at least one available-externally we could end up needing a symbol referenced by the available-externally as a result of a backend inlining it into a caller. So we would need to keep them live anyway.
Now that I think about it, this applies to linkonce-odr as well (i.e. we could convert them to available-externally as a result of non-prevailing, and then inline them in the backend and thus end up needing a symbol that was referenced by the available-externally but not necessarily by the prevailing copy of the global). But that's somewhat of an orthogonal problem to this.
Repository:
rL LLVM
https://reviews.llvm.org/D43690
More information about the llvm-commits
mailing list