[PATCH] D29367: LTO: Link non-prevailing weak_odr, linkonce_odr or available_externally globals into the combined module with available_externally linkage.

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 31 20:07:44 PST 2017

tejohnson added inline comments.

Comment at: llvm/lib/LTO/LTO.cpp:478
+        if (CombinedGV && CombinedGV->hasAvailableExternallyLinkage()) {
+          // Remove the body of any available_externally copy of the symbol that
+          // we may have linked below. We can only ever get here with a
Will the IRLinker not replace the existing available_externally definition with the prevailing copy since it is added above to Keep (ValuesToLink)?

Comment at: llvm/lib/LTO/LTO.cpp:484
+          CombinedGO->setLinkage(GlobalValue::ExternalLinkage);
+          CombinedGO->setComdat(nullptr);
+          CombinedGO->clearMetadata();
CombinedGO should never have a Comdat at this point, since it was available_externally.


More information about the llvm-commits mailing list