This is an archive of the discontinued LLVM Phabricator instance.

[SampleProfile] Repeat indirect call promotion only when the target is actually hot.
ClosedPublic

Authored by twoh on Mar 28 2019, 8:48 AM.

Details

Summary

It is possible that multiple indirect call targets have been promoted for a single callsite from the profiled binary. Current implementation repeats promotion for all these targets as far as the callsite itself is hot (the callsite is assumed to be hot if any one of these targets was "hot" during the profiling). However, even when one of the ICPed target is hot other targets may not, and we should not repeat promotion for "cold" targets.

Event Timeline

twoh created this revision.Mar 28 2019, 8:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 28 2019, 8:48 AM
twoh updated this revision to Diff 192647.Mar 28 2019, 8:50 AM

Remove unnecessary metadata.

wmi accepted this revision.Apr 1 2019, 4:13 PM

Thanks! The change makes a lot sense to me.

llvm/test/Transforms/SampleProfile/cold-indirect-call.ll
2

Could you add the check for new pass manager too?

This revision is now accepted and ready to land.Apr 1 2019, 4:13 PM
twoh updated this revision to Diff 193235.Apr 1 2019, 11:33 PM

Check for the new pass manager added. Thanks @wmi for the comment!

This revision was automatically updated to reflect the committed changes.