[PATCH] D18346: ThinLTO: special handling for LinkOnce functions

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 1 12:51:24 PDT 2016


tejohnson accepted this revision.
This revision is now accepted and ready to land.

================
Comment at: lib/LTO/ThinLTOCodeGenerator.cpp:190
@@ +189,3 @@
+  for (auto &GV : TheModule.globals()) {
+    if (!GlobalInvolvedWithAlias.count(&GV))
+      ResolveODR(GV, Index, TheModule.getModuleIdentifier());
----------------
Ok, that's fine. Note as an aside that the gold plugin is already doing the linkonce->weak transformation for the prevailing copy, but was motivated by correctness reasons (see D16173 - the preempted copies will get dropped, and since this isn't full LTO the backend doesn't see all references and may otherwise drop the prevailing linkonce copy). Note also that in the future you could do linkonce(any)->weak(any), just not the avail externally part for the non-odr.


http://reviews.llvm.org/D18346





More information about the llvm-commits mailing list