This is an archive of the discontinued LLVM Phabricator instance.

llvm-profdata: Reduce memory usage by using Error callback rather than member
ClosedPublic

Authored by dblaikie on Jul 7 2017, 2:45 PM.

Details

Summary

Reduces llvm-profdata memory usage on a large profile from 7.8GB to 5.1GB.

This also allows all the errors/warnings to be printed rather than only
the first.

Diff Detail

Repository
rL LLVM

Event Timeline

dblaikie created this revision.Jul 7 2017, 2:45 PM
dblaikie updated this revision to Diff 105703.Jul 7 2017, 2:47 PM

Improve description

davidxl edited edge metadata.Jul 7 2017, 3:28 PM

It feels weird that the error handling is the first parameter of the interfaces. Also is it possible to provide a default error handling ?

tools/llvm-profdata/llvm-profdata.cpp
164 ↗(On Diff #105703)

creating a named lambda is more readable IMO.

Harbormaster completed remote builds in B8065: Diff 105703.
dblaikie updated this revision to Diff 105801.Jul 9 2017, 6:10 PM

Move warning callback to the last argument.

davidxl added inline comments.Jul 9 2017, 7:05 PM
include/llvm/ProfileData/InstrProf.h
585 ↗(On Diff #105801)

It is better to get rid of the default weight and move Warn to be the last here.

660 ↗(On Diff #105801)

can Warn be moved to the last for this one?

729 ↗(On Diff #105801)

Same here

734 ↗(On Diff #105801)

Same here

dblaikie updated this revision to Diff 105804.Jul 9 2017, 7:54 PM

Move function_ref to the last arg in the InstrProfRecord APIs

davidxl accepted this revision.Jul 9 2017, 8:00 PM

lgtm

This revision is now accepted and ready to land.Jul 9 2017, 8:00 PM
This revision was automatically updated to reflect the committed changes.