This is an archive of the discontinued LLVM Phabricator instance.

Re-factor sample profile reader into lib/ProfileData.
ClosedPublic

Authored by dnovillo on Sep 8 2014, 12:31 PM.

Details

Summary

This patch moves the profile reading logic out of the Sample Profile
transformation into a generic profile reader facility in
lib/ProfileData.

The intent is to use this new reader to implement a sample profile
reader/writer that can be used to convert sample profiles from external
sources into LLVM.

This first patch introduces no functional changes. It moves the profile
reading code from lib/Transforms/SampleProfile.cpp into
lib/ProfileData/SampleProfReader.cpp.

In subsequent patches I will:

  • Add a bitcode format for sample profiles to allow for more efficient encoding of the profile.
  • Add a writer for both text and bitcode format profiles.
  • Add a 'convert' command to llvm-profdata to be able to convert between the two (and serve as entry point for other sample profile formats).

Diff Detail

Repository
rL LLVM

Event Timeline

dnovillo updated this revision to Diff 13412.Sep 8 2014, 12:31 PM
dnovillo retitled this revision from to Re-factor sample profile reader into lib/ProfileData..
dnovillo updated this object.
dnovillo edited the test plan for this revision. (Show Details)
dnovillo added reviewers: bogner, echristo.
dnovillo added a subscriber: Unknown Object (MLST).
echristo accepted this revision.Sep 8 2014, 3:39 PM
echristo edited edge metadata.

LGTM as well.

As a note the required, optional, required, optional bit for the sampled lines is a bit weird :)

This revision is now accepted and ready to land.Sep 8 2014, 3:39 PM
dnovillo closed this revision.Sep 9 2014, 5:50 AM
dnovillo updated this revision to Diff 13454.

Closed by commit rL217437 (authored by @dnovillo).