This is an archive of the discontinued LLVM Phabricator instance.

[SamplePGO] Skip inlinee profile scaling for sample loader inlining
ClosedPublic

Authored by wenlei on Mar 8 2021, 8:33 AM.

Details

Summary

For CGSCC inline, we need to scale down a function's branch weights and entry counts when thee it's inlined at a callsite. This is done through updateCallProfile. Additionally, we also scale the weigths for the inlined clone based on call site count in updateCallerBFI. Neither is needed for inlining during sample profile loader as it's using context profile that is separated from inlinee's own profile. This change skip the inlinee profile scaling for sample loader inlining.

Diff Detail

Event Timeline

wenlei created this revision.Mar 8 2021, 8:33 AM
wenlei requested review of this revision.Mar 8 2021, 8:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 8 2021, 8:33 AM
wenlei added a comment.Mar 8 2021, 8:42 AM

We have this change internally, and it shows a 0.2-0.3% geomean win on spec2017 with CSSPGO (from small wins on larger ones like xalancbmk). I think it should help baseline AutoFDO too.

hoy accepted this revision.Mar 8 2021, 11:41 AM
This revision is now accepted and ready to land.Mar 8 2021, 11:41 AM

@wmi any concern with landing this change? I don't expect any issues, but just to be prudent do you want to experiment before this is landed?

wmi added a comment.Mar 10 2021, 9:59 PM

@wmi any concern with landing this change? I don't expect any issues, but just to be prudent do you want to experiment before this is landed?

That is a nice catch! I will definitely experiment it and expect some improvement from it. Will have the data tomorrow and get back.

wmi accepted this revision.Mar 11 2021, 9:31 AM
In D98187#2618612, @wmi wrote:

@wmi any concern with landing this change? I don't expect any issues, but just to be prudent do you want to experiment before this is landed?

That is a nice catch! I will definitely experiment it and expect some improvement from it. Will have the data tomorrow and get back.

I got ~0.2% improvement on our search benchmark. That is a nice improvement. Thanks!

In D98187#2619936, @wmi wrote:
In D98187#2618612, @wmi wrote:

@wmi any concern with landing this change? I don't expect any issues, but just to be prudent do you want to experiment before this is landed?

That is a nice catch! I will definitely experiment it and expect some improvement from it. Will have the data tomorrow and get back.

I got ~0.2% improvement on our search benchmark. That is a nice improvement. Thanks!

Thanks for the measurement, great to know it helps.