This is an archive of the discontinued LLVM Phabricator instance.

Use LineLocation instead of CallsiteLocation to index callsite profile.
ClosedPublic

Authored by danielcdh on Mar 2 2016, 2:15 PM.

Details

Summary

With discriminator, LineLocation can uniquely identify a callsite without the need to specifying callee name. Remove Callee function name from the key, and put it in the value (FunctionSamples).

Diff Detail

Event Timeline

danielcdh updated this revision to Diff 49667.Mar 2 2016, 2:15 PM
danielcdh retitled this revision from to Use LineLocation instead of CallsiteLocation to index callsite profile..
danielcdh updated this object.
danielcdh added reviewers: dnovillo, davidxl.
danielcdh added a subscriber: llvm-commits.
dnovillo edited edge metadata.Mar 2 2016, 2:36 PM

Nice cleanup! I think we can prevent breaking the AutoFDO tool by adding an overload.

include/llvm/ProfileData/SampleProf.h
284

Add documentation for this field. Indicate that this is the mangled name of the function.

include/llvm/ProfileData/SampleProfWriter.h
38–43

This will break the AutoFDO tool.

Idea: keep the old call as a temporary overload. This gives you time to fix AutoFDO without it breaking on you in the interim. The version of SampleProfileWriter::write() that takes FName as an argument simply does nothing with it.

danielcdh updated this revision to Diff 49679.Mar 2 2016, 3:07 PM
danielcdh marked 2 inline comments as done.
danielcdh edited edge metadata.

keep old writer interface.

include/llvm/ProfileData/SampleProfWriter.h
38–43

Thanks for bring this up.

dnovillo accepted this revision.Mar 2 2016, 3:32 PM
dnovillo edited edge metadata.

LGTM. Thanks.

Just to make sure AutoFDO is still working, would you mind building it with your LLVM build to make sure that create_llvm_prof still works?

This revision is now accepted and ready to land.Mar 2 2016, 3:32 PM
danielcdh closed this revision.Mar 3 2016, 10:14 AM