This is an archive of the discontinued LLVM Phabricator instance.

[CSSPGO][Preinliner] Bump up the threshold to favor previous compiler inline decision.
ClosedPublic

Authored by hoy on Jun 26 2023, 11:51 AM.

Details

Summary

The compiler has more insight and knowledge about functions based on their IR and attribures and should make a better inline decision than the offline preinliner does which is purely based on callsites hotness and code size. Therefore I'm making changes to favor previous compiler inline decision by bumping up the callsite allowance.

This should improve the performance by more than 1% according to testing on Meta services.

Diff Detail

Event Timeline

hoy created this revision.Jun 26 2023, 11:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 26 2023, 11:51 AM
hoy requested review of this revision.Jun 26 2023, 11:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 26 2023, 11:51 AM
hoy updated this revision to Diff 534684.Jun 26 2023, 11:54 AM

Updating D153797: [CSSPGO][Preinliner] Bump up the threshold to favor previous compiler inline decision.

wenlei added inline comments.Jun 26 2023, 12:01 PM
llvm/tools/llvm-profgen/CSPreInliner.cpp
199

Make this a tunable value via a switch?

hoy added inline comments.Jun 26 2023, 12:03 PM
llvm/tools/llvm-profgen/CSPreInliner.cpp
199

Sounds good.

Forgot to mention that smaller numbers like 10, 25, 50 don't give as good win as 100 gives.

hoy updated this revision to Diff 534735.Jun 26 2023, 1:39 PM

Addressing feedbacks.

wenlei accepted this revision.Jun 26 2023, 4:53 PM

lgtm, thanks.

This revision is now accepted and ready to land.Jun 26 2023, 4:53 PM
wenlei added inline comments.Jun 26 2023, 4:54 PM
llvm/tools/llvm-profgen/CSPreInliner.cpp
61

multipifier->multiplier for all instances in switch name, variable names.

61

and switch desc too.

hoy added inline comments.Jun 26 2023, 5:09 PM
llvm/tools/llvm-profgen/CSPreInliner.cpp
61

Good catch.

hoy updated this revision to Diff 534791.Jun 26 2023, 5:09 PM

Updating D153797: [CSSPGO][Preinliner] Bump up the threshold to favor previous compiler inline decision.

This revision was landed with ongoing or failed builds.Jun 26 2023, 5:21 PM
This revision was automatically updated to reflect the committed changes.