This is an archive of the discontinued LLVM Phabricator instance.

[Profile] add support for reading directory as input for profile merging
ClosedPublic

Authored by davidxl on Jul 20 2016, 12:11 AM.

Details

Summary

With this patch, directory name can be specified as a positional input or as part of the weighted pairs in command line or input file specification file.

This is useful for use cases where user only cares to specify the profile data directory.

Diff Detail

Repository
rL LLVM

Event Timeline

davidxl updated this revision to Diff 64643.Jul 20 2016, 12:11 AM
davidxl retitled this revision from to [Profile] add support for reading directory as input for profile merging.
davidxl updated this object.
davidxl added a reviewer: vsk.
davidxl added a subscriber: llvm-commits.
vsk edited edge metadata.Jul 20 2016, 11:55 AM

Mostly looks good.

tools/llvm-profdata/llvm-profdata.cpp
328 ↗(On Diff #64643)

Invert the check and exit early here to flatten the code a bit.

341 ↗(On Diff #64643)

Should we emit a warning if the loop exits due to an error?

412 ↗(On Diff #64643)

We might be able to get rid of some string copies here if we added a constructor to WeightedFile which accepts a std::string&&. We can clean that up later though.

davidxl updated this revision to Diff 64749.Jul 20 2016, 1:33 PM
davidxl edited edge metadata.

Addressed review feedbacks.

vsk accepted this revision.Jul 20 2016, 1:36 PM
vsk edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Jul 20 2016, 1:36 PM
This revision was automatically updated to reflect the committed changes.