[PATCH] D61255: [ThinLTO] Make weak data symbols prevailing when they're visible to regular object

Eugene Leviant via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 29 11:02:25 PDT 2019


evgeny777 added a comment.

It isn't working, because llvm::computeDeadSymbols keeps non-prevailing linkonce_odr and weak_odr symbols live.
It is possible to check for function summary when doing this to fix the issue:

  if (S->linkage() == GlobalValue::AvailableExternallyLinkage ||
      ((S->linkage() == GlobalValue::WeakODRLinkage ||
      S->linkage() == GlobalValue::LinkOnceODRLinkage) && isa<FunctionSummary>(S->getBaseObject())))
    KeepAliveLinkage = true;

however this will prevent optimizing out linkonce_odr and weak_odr constants


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61255/new/

https://reviews.llvm.org/D61255





More information about the llvm-commits mailing list