This is an archive of the discontinued LLVM Phabricator instance.

[PGO] Refactor the valule profile dumping function for ease of adding other profile kind
ClosedPublic

Authored by xur on Mar 8 2017, 12:37 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

xur created this revision.Mar 8 2017, 12:37 PM
davidxl added inline comments.Mar 8 2017, 12:46 PM
tools/llvm-profdata/llvm-profdata.cpp
559 ↗(On Diff #91059)

Better to extract the driver loop into a common function, eg: traverseAllValueSites, and then pass a lambda/callback to do different things such as collect stats or dumping.

xur updated this revision to Diff 91109.Mar 8 2017, 4:35 PM
xur added inline comments.
tools/llvm-profdata/llvm-profdata.cpp
559 ↗(On Diff #91059)

it's hard to use a lambda function here as I need to function pointers with captures. I pass all the necessary data variables as the parameters instead.

davidxl accepted this revision.Mar 8 2017, 6:41 PM

lgtm

This revision is now accepted and ready to land.Mar 8 2017, 6:41 PM
This revision was automatically updated to reflect the committed changes.