This is an archive of the discontinued LLVM Phabricator instance.

[CSSPGO][Preinliner] Use one for zero-sized functions when computing inline budge
AbandonedPublic

Authored by hoy on Nov 17 2022, 11:50 AM.

Details

Reviewers
wenlei
wlei
Summary

Use one to avoid multiplication with a zero func size which otherwise would result in no inlining. This could happen when all of the original function's code is gone and only inlined code is left.

Testing on one internal benchmark shows neutral perf impact, but dynamic instruction count reduces by 0.5%. Also there are visible differences in generated profile.

Diff Detail

Event Timeline

hoy created this revision.Nov 17 2022, 11:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 17 2022, 11:50 AM
Herald added subscribers: modimo, wenlei. · View Herald Transcript
hoy requested review of this revision.Nov 17 2022, 11:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 17 2022, 11:50 AM
wlei added a comment.Nov 17 2022, 12:00 PM

I think we actually will use the ProfileInlineLimitMin which is 100 for the count, see SizeLimit = std::max(SizeLimit, (unsigned)ProfileInlineLimitMin);

ProfileInlineGrowthLimit is by default set to 12, and 1 * 12 is still smaller than 100.

hoy planned changes to this revision.Nov 17 2022, 12:06 PM

I think we actually will use the ProfileInlineLimitMin which is 100 for the count, see SizeLimit = std::max(SizeLimit, (unsigned)ProfileInlineLimitMin);

ProfileInlineGrowthLimit is by default set to 12, and 1 * 12 is still smaller than 100.

Oh yes, you are right. This change is supposed to be on top of another change which replaces ProfileInlineLimitMin with a multiplifier ProfileInlineGrowthLimitMin.

Abandoning this for now until rebased.

hoy abandoned this revision.Jun 26 2023, 3:43 PM