This is an archive of the discontinued LLVM Phabricator instance.

[ICP] Don't promote when target not defined in module
ClosedPublic

Authored by tejohnson on Dec 7 2020, 5:16 PM.

Details

Summary

This guards against cases where the symbol was dead code eliminated in
the binary by ThinLTO, and we have a sample profile collected for one
binary but used to optimize another.

Most of the benefit from ICP comes from inlining the target, which we
can't do with only a declaration anyway. If this is in the pre-ThinLTO
link step (e.g. for instrumentation based PGO), we will attempt the
promotion again in the ThinLTO backend after importing anyway, and we
don't need the early promotion to facilitate that.

Diff Detail

Event Timeline

tejohnson created this revision.Dec 7 2020, 5:16 PM
tejohnson requested review of this revision.Dec 7 2020, 5:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 7 2020, 5:16 PM
wmi accepted this revision.Dec 7 2020, 5:28 PM

LGTM.

This revision is now accepted and ready to land.Dec 7 2020, 5:28 PM
This revision was landed with ongoing or failed builds.Dec 8 2020, 7:45 AM
This revision was automatically updated to reflect the committed changes.