This is an archive of the discontinued LLVM Phabricator instance.

Refactor synthetic profile count computation. NFC.
ClosedPublic

Authored by eraman on Jan 8 2019, 4:39 PM.

Details

Summary

Instead of using two separate callbacks to return the entry count and the
relative block frequency, use a single callback to return callsite
count. This would allow better supporting hybrid mode in the future as
the count of callsite need not always be derived from entry count (as in
sample PGO).

Diff Detail

Event Timeline

eraman created this revision.Jan 8 2019, 4:39 PM
davidxl added inline comments.Jan 8 2019, 4:47 PM
lib/Analysis/SyntheticCountsUtils.cpp
62

To avoid overflow, AdditionalCounts be changed to a map to Scaled64?

eraman updated this revision to Diff 180774.Jan 8 2019, 5:24 PM

Address review comments

eraman marked an inline comment as done.Jan 8 2019, 5:25 PM

Also defined AddCountTy to be function_ref<void(NodeRef, Scaled64)>

davidxl accepted this revision.Jan 8 2019, 6:37 PM

lgtm

This revision is now accepted and ready to land.Jan 8 2019, 6:37 PM
This revision was automatically updated to reflect the committed changes.