This is an archive of the discontinued LLVM Phabricator instance.

[ThinLTO] Teach ThinLTO about auto hide symbols
ClosedPublic

Authored by steven_wu on Feb 9 2018, 10:10 AM.

Details

Summary

For symbols that has linkonce_odr linkage and unnamed_addr, it can be
auto hide by linker to avoid weak external symbols. Teach ThinLTO to
perform auto hide so it can safely promote linkonce_odr to weak symbols
without breaking this nice property.

Diff Detail

Event Timeline

steven_wu created this revision.Feb 9 2018, 10:10 AM
tejohnson accepted this revision.Feb 9 2018, 10:25 AM

LGTM although I have a suggestion on where to move the new code.

lib/Transforms/IPO/FunctionImport.cpp
693

Suggest moving the new check down into this else, which is the only condition under which it could be true, to avoid unnecessary checking.

This revision is now accepted and ready to land.Feb 9 2018, 10:25 AM
steven_wu updated this revision to Diff 133646.Feb 9 2018, 10:30 AM

Move the check later so it is only check when needed.

This revision was automatically updated to reflect the committed changes.