This is an archive of the discontinued LLVM Phabricator instance.

[SamplePGO] Add switch to honor zero count on block level as accurate
ClosedPublic

Authored by wenlei on Sep 20 2021, 5:43 PM.

Details

Summary

Add a new LLVM switch -profile-sample-block-accurate to trust zero block counts for branches. Currently we leave out such zero counts when annotating branch weight metadata, which would lead to weights being considered as unknown.

Diff Detail

Event Timeline

wenlei created this revision.Sep 20 2021, 5:43 PM
wenlei requested review of this revision.Sep 20 2021, 5:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 20 2021, 5:43 PM

This turns out to improve HHVM (https://github.com/facebook/hhvm) RPS by 0.1%, while reducing .text size by 4%, using AutoFDO. I hope to get it in first so we can do more evaluation. Eventually either add a new driver switch just like fprofile-sample-accurate, or merge it into fprofile-sample-accurate if it turns out to be helpful in general.

wenlei added a reviewer: xur.Sep 20 2021, 5:47 PM
hoy accepted this revision.Sep 21 2021, 5:05 PM

lgtm.

This revision is now accepted and ready to land.Sep 21 2021, 5:05 PM
This revision was landed with ongoing or failed builds.Sep 21 2021, 5:13 PM
This revision was automatically updated to reflect the committed changes.