This is an archive of the discontinued LLVM Phabricator instance.

Move metadata linking after lazy global materialization/linking.
ClosedPublic

Authored by tejohnson on Oct 29 2015, 9:47 PM.

Details

Summary

Currently, named metadata is linked before the LazilyLinkGlobalValues
list is walked and materialized/linked. As a result, references
from DISubprogram and DIGlobalVariable metadata to yet unmaterialized
functions and variables cause them to be added to the lazy linking
list and their definitions are materialized and linked.

This makes the llvm-link -only-needed option not have the intended
effect when debug information is present, as the otherwise unneeded
functions/variables are still linked in.

Additionally, for ThinLTO I have implemented a mechanism to only link
in debug metadata needed by imported functions. Moving named metadata
linking after lazy GV linking will facilitate applying this mechanism
to the LTO and "llvm-link -only-needed" cases as well.

Diff Detail

Repository
rL LLVM

Event Timeline

tejohnson updated this revision to Diff 38784.Oct 29 2015, 9:47 PM
tejohnson retitled this revision from to Move metadata linking after lazy global materialization/linking..
tejohnson updated this object.
tejohnson added reviewers: dexonsmith, tra, dblaikie.
tejohnson added a subscriber: llvm-commits.
This revision was automatically updated to reflect the committed changes.

I can't seem to get Phab to reopen this issue since the previous
commit closed it. So ignore this and please look at the new revision I
just created in D14447.