This is an archive of the discontinued LLVM Phabricator instance.

[CSSPGO] Enable stale profile matching by default for CSSPGO
ClosedPublic

Authored by wlei on Jun 28 2023, 5:22 PM.

Details

Summary

We tested the stale profile matching on several Meta's internal services, all results are positive, for instance, in one service that refreshed its profile every one or two weeks, it consistently gave 1~2% performance improvement. We also observed an instance that a trivial refactoring caused a 2% regression and the matching can successfully recover the whole regression. Therefore, we'd like to turn it on by default for CSSPGO.

Diff Detail

Event Timeline

wlei created this revision.Jun 28 2023, 5:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 28 2023, 5:22 PM
wlei requested review of this revision.Jun 28 2023, 5:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 28 2023, 5:22 PM
wlei edited the summary of this revision. (Show Details)Jun 28 2023, 5:25 PM
wlei added reviewers: hoy, wenlei.
wenlei accepted this revision.Jun 28 2023, 5:26 PM

lgtm, thanks!

This revision is now accepted and ready to land.Jun 28 2023, 5:26 PM
hoy added a comment.Jun 28 2023, 5:27 PM

Thanks for the change. Would be good to call out some rough numbers measured with our internal services.

llvm/lib/Transforms/IPO/SampleProfile.cpp
2052

Wrap this under a check of profileIsPseudoProbed?

wlei edited the summary of this revision. (Show Details)Jun 28 2023, 5:47 PM
wlei updated this revision to Diff 535585.Jun 28 2023, 5:48 PM

addressing feedback.

wenlei added inline comments.Jun 28 2023, 5:50 PM
llvm/lib/Transforms/IPO/SampleProfile.cpp
2053

nit: combine the two ifs.

also add a comment why pseudo probe is needed.

wlei updated this revision to Diff 535595.Jun 28 2023, 6:21 PM

addressing feedback, updated the comments.

hoy accepted this revision.Jun 28 2023, 6:34 PM
This revision was automatically updated to reflect the committed changes.