This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by mehdi_amini on Apr 19 2016, 9:46 PM.

Details

Summary

There is no change in the validation, I'm not sure if it is dead code?

Diff Detail

Event Timeline

mehdi_amini retitled this revision from to ModuleLinker: only import what is in the GlobalsToImport for ThinLTO, regarless if it is a function or not..
mehdi_amini updated this object.
mehdi_amini added a reviewer: tejohnson.
mehdi_amini added a subscriber: llvm-commits.
tejohnson accepted this revision.Apr 19 2016, 10:06 PM
tejohnson edited edge metadata.

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.

lib/Linker/LinkModules.cpp
271–272

Move this up above the isDeclarationForLinker calls since the results are no longer used here.

This revision is now accepted and ready to land.Apr 19 2016, 10:06 PM
mehdi_amini edited edge metadata.

Move check above