[PATCH] D19307: ModuleLinker: only import what is in the GlobalsToImport for ThinLTO, regarless if it is a function or not.

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 22:06:10 PDT 2016


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

The alias handling was specific to the old iterative inlining mechanism, so that is dead now. I would expect the variable handling to make a difference, since we were previously falling through to the normal selection logic. E.g. dest copy is an external decl but src has a definition - we would have picked the src copy but now will not (assuming variable not in GlobalsToImport set). I think the change is good given that is how the GlobalsToImport set is currently intended though. But would be good to confirm with a test case that previously we were doing the wrong thing w.r.t. variables and now are doing the right thing here.


================
Comment at: lib/Linker/LinkModules.cpp:274
@@ -273,2 +273,3 @@
 
   if (isPerformingImport()) {
+    // LinkFromSrc iff this is a global requested for importing.
----------------
Move this up above the isDeclarationForLinker calls since the results are no longer used here.


http://reviews.llvm.org/D19307





More information about the llvm-commits mailing list