This is an archive of the discontinued LLVM Phabricator instance.

[SampleFDO] Do not scale the magic number NOMORE_ICP_MAGICNUM in value profile during profile update.
ClosedPublic

Authored by wmi on Mar 25 2021, 5:30 PM.

Details

Summary

When we inline a function and update the profile, the value profiles of the indirect call in the inliner and inlinee will be scaled. In https://reviews.llvm.org/D96806 and https://reviews.llvm.org/D97350, we start using the magic number NOMORE_ICP_MAGICNUM (-1) to mark targets which have been promoted. The magic number shouldn't be scaled during the profile update.

Although the problem has been suppressed by https://reviews.llvm.org/D98187 for SampleFDO, which stops profile update for inlining in sampleFDO, the patch is still wanted since it will be more consistent to handle the magic number properly in profile update.

Diff Detail

Event Timeline

wmi created this revision.Mar 25 2021, 5:30 PM
wmi requested review of this revision.Mar 25 2021, 5:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 25 2021, 5:30 PM
davidxl accepted this revision.Mar 25 2021, 7:56 PM

lgtm

This revision is now accepted and ready to land.Mar 25 2021, 7:56 PM
hoy accepted this revision.Mar 25 2021, 10:25 PM

LGTM, thanks for the fix.

wenlei accepted this revision.Mar 25 2021, 10:28 PM

lgtm too.

This revision was landed with ongoing or failed builds.Mar 29 2021, 9:34 AM
This revision was automatically updated to reflect the committed changes.