This is an archive of the discontinued LLVM Phabricator instance.

[ProfileSummary] Add the PartialProfileRatio field in ProfileSummary metadata.
ClosedPublic

Authored by hjyamauchi on May 14 2020, 11:05 AM.

Details

Summary

PartialProfileRatio approximately represents the ratio of the number of profile
counters of the program being built to the number of profile counters in the
partial sample profile. It is used to scale the working set size under the
partial sample profile to reflect the size of the program being built and to
improve the working set size heuristics.

This is a split from D79831.

Diff Detail

Event Timeline

hjyamauchi created this revision.May 14 2020, 11:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 14 2020, 11:05 AM
wmi added a subscriber: wmi.May 18 2020, 11:55 AM
wmi added inline comments.
llvm/include/llvm/IR/ProfileSummary.h
96–97

Can we add an assertion that Partial is true for getter and setter of PartialProfileRatio?

davidxl added inline comments.May 19 2020, 9:32 AM
llvm/lib/IR/ProfileSummary.cpp
77

Document the new parameter in the comment.

197–198

can you commit the style changes as NFC first?

hjyamauchi marked 5 inline comments as done.

Address comments.

llvm/include/llvm/IR/ProfileSummary.h
96–97

Done for the setter, but it does not work for the getter as getMD will query the field value along with all the fields and just even to write a false value for it, even when it's not partial. Just querying seems okay.

llvm/lib/IR/ProfileSummary.cpp
197–198

Sure, will do.

hjyamauchi marked an inline comment as done.
hjyamauchi added inline comments.
llvm/lib/IR/ProfileSummary.cpp
197–198

Split it into D80230.

wmi added inline comments.May 20 2020, 1:58 PM
llvm/include/llvm/IR/ProfileSummary.h
98

Ok, better have some message in the assert.

wmi accepted this revision.May 20 2020, 1:59 PM
wmi added a reviewer: wmi.

LGTM.

This revision is now accepted and ready to land.May 20 2020, 2:00 PM
hjyamauchi marked 2 inline comments as done.

Address comments.

llvm/include/llvm/IR/ProfileSummary.h
98

Done.

This revision was automatically updated to reflect the committed changes.