[PATCH] D19096: ModuleLinker: do not always pull-in linkonce_odr when performing ThinLTO importing

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 17:13:52 PDT 2016


tejohnson added inline comments.

================
Comment at: lib/LTO/ThinLTOCodeGenerator.cpp:230
@@ +229,3 @@
+                 << GV.getLinkage() << " to " << NewLinkage->second << "\n");
+    GV.setLinkage(NewLinkage->second);
+  }
----------------
Doesn't this mean we will end up with available_externally aliases, which would be illegal? I.e. alias was linkonce or weak and is not the first definition for linker, so NewLinkage is available_externally. 

================
Comment at: lib/Transforms/IPO/FunctionImport.cpp:169
@@ -168,2 +168,3 @@
           &cast<AliasSummary>(CalleeSummary)->getAliasee());
-    else
+      if (!GlobalValue::isLinkOnceODRLinkage(ResolvedCalleeSummary->linkage())) {
+        // Alias can't point to "available_externally". However when we import
----------------
The fix to move this check here instead of being later in importFunctions() seems independent from the rest of this patch - can/should it be committed separately?

================
Comment at: tools/llvm-link/llvm-link.cpp:280
@@ +279,3 @@
+    // Instruct the linker to not automatically import linkonce defintion.
+    unsigned Flags = Linker::Flags::DontForceLinkLinkonceODR;
+
----------------
Doesn't the ODR resolution need to be done to set this flag? I don't see it being done in llvm-link.


http://reviews.llvm.org/D19096





More information about the llvm-commits mailing list