This is an archive of the discontinued LLVM Phabricator instance.

ThinLTO: Don't import imported entities (not even local ones)
AbandonedPublic

Authored by dblaikie on Jul 25 2017, 8:49 PM.

Details

Reviewers
tejohnson
Summary

This was my mistake/bad advice when this feature was being implemented -
currently local imported entities are only attached to function
definitions - and definitions are created (even though there's no code
for them) in the DWARF to attach the imported entity to if no definition
exists otherwise.

So importing the imported entities when the only thing that's going to
be produced is inline definitions is unnecessary & also leads to
creationg of extra CUs to house the synthesized definition which is
otherwise unused.

At some point the imported entity work could be improved on, to (as the
old comment mentions) move local imported entities to be attached to the
function/subprogram so they would eb dropped/imported naturally - but
also to ensure the imported entities go on the appropriate entities
(maybe even on the inlined subroutine, or on the abstract origin(s)
(there may be multiple abstract origins when doing Fission(especially
DWP)+LTO because cross-CU references aren't possible there))

Event Timeline

dblaikie created this revision.Jul 25 2017, 8:49 PM
This revision is now accepted and ready to land.Jul 26 2017, 9:45 AM
dblaikie abandoned this revision.Jul 26 2017, 10:37 AM

Actually realized there's a better/different direction for this (more debug focussed & able to use this info better rather than skipping/dropping/omitting it). Thanks for looking though!