This is an archive of the discontinued LLVM Phabricator instance.

Common infrastructure for reading a profile remapping file and building a mangling remapper from it.
ClosedPublic

Authored by rsmith on Aug 24 2018, 6:16 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

rsmith created this revision.Aug 24 2018, 6:16 PM
rsmith retitled this revision from Add readers for sample and instruction profile data that remap the mangled names from the underlying profile file. to Common infrastructure for reading a profile remapping file and building a mangling remapper from it..Aug 24 2018, 6:22 PM
rsmith updated this revision to Diff 162527.Aug 24 2018, 6:22 PM
This comment was removed by rsmith.
davidxl added inline comments.Aug 26 2018, 9:58 PM
include/llvm/ProfileData/ProfRemappingReader.h
103 ↗(On Diff #162527)

It is unclear what semantic this method has from the comments: why do we need to map function name in profile data to profile data key? should they be the same? The lookup method, on the other hand, is very clear.

rsmith updated this revision to Diff 162731.Aug 27 2018, 12:58 PM

Add comments and rename remap to insert for clarity.

rsmith marked an inline comment as done.Aug 27 2018, 12:59 PM
rsmith updated this revision to Diff 163235.Aug 29 2018, 5:27 PM

Move symbol remapping reader to Support in preparation for using it from a tool
that's not specific to profiling data.

Perhaps add some test cases for the parser and reader?

include/llvm/Support/SymbolRemappingReader.h
34 ↗(On Diff #163235)

what is the difference between name and encoding? Can you add an encoding example?

rsmith updated this revision to Diff 164536.Sep 7 2018, 4:09 PM
rsmith marked an inline comment as done.

Add tests and extend file comment to give an example of <encoding>.

rsmith added a comment.Sep 7 2018, 4:09 PM

Perhaps add some test cases for the parser and reader?

Sure. (This was intended to be committed with users of this functionality, which have their own tests, but testing the parse errors seems like a good idea.)

include/llvm/Support/SymbolRemappingReader.h
34 ↗(On Diff #163235)

An <encoding> allows you to reference a particular overload of a function or a particular specialization of a function template. Remapping a <name> would instead always remap an entire overload set. Example added.

davidxl accepted this revision.Sep 7 2018, 5:10 PM

lgtm

This revision is now accepted and ready to land.Sep 7 2018, 5:10 PM
This revision was automatically updated to reflect the committed changes.