This is an archive of the discontinued LLVM Phabricator instance.

[llvm-profdata] Adjust profile supplementation heuristics
ClosedPublic

Authored by xur on Aug 24 2022, 1:36 PM.

Details

Summary

(1) We now use the count size in FDO as the main factor to deal with pre-inliner.
Currently we use the number of sample records in the SampleFDO profile. But
that only counts the top-level body sample records (not including the nested
call-sites). We are seeing some big functions not being updated because of
this. I think using the count size in FDO profile is more reasonable to judge if
the function is likely to be inlined to the callers in pre-inliner.

(2) We use getMaxCount in SampleFDO rather the HeadSample to determine if
if the function is hot in SampleFDO. This is in-sync with the logic
in the compiler (also HeadSample can be 0).

Diff Detail

Event Timeline

xur created this revision.Aug 24 2022, 1:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 24 2022, 1:36 PM
Herald added a subscriber: wenlei. · View Herald Transcript
xur requested review of this revision.Aug 24 2022, 1:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 24 2022, 1:36 PM
davidxl accepted this revision.Aug 24 2022, 2:17 PM

lgtm

This revision is now accepted and ready to land.Aug 24 2022, 2:17 PM
This revision was automatically updated to reflect the committed changes.