This adds support to convert ProfileSummary object to Metadata and create a ProfileSummary object from metadata. This would allow attaching profile summary information to Module allowing optimization passes to use it.
Diff Detail
Event Timeline
Looks fine to me, though I'm not an expert on MD.
include/llvm/ProfileData/ProfileCommon.h | ||
---|---|---|
59 | Nit. Do we really need the prefix 'ProfileSummary'? This enum already needs to be referred as 'ProfileSummary::ProfileSummaryKind'. I think 'ProfileSummary::Kind' reads a bit better. | |
lib/ProfileData/ProfileSummary.cpp | ||
150 | s/a MDTuple/an MDTuple/ | |
151 | s/a MDTuple/an MDTuple/. This happens in a couple other places. | |
318 | s/an/a/ |
include/llvm/ProfileData/ProfileCommon.h | ||
---|---|---|
59 | I agree with that sentiment. I was following the example in Metadata which has an enum named MetadataKind, but I also see some other classes with just the name Kind. So I've renamed it to Kind. | |
lib/ProfileData/ProfileSummary.cpp | ||
255 | In practice, this is going to be of fixed size (the same as DefaultCutoffs). Is SmallVector a better choice instead of std::vector ? |
Added a typedef for std::vector<ProfileSummaryEntry>. Will check this in with that change.
Nit. Do we really need the prefix 'ProfileSummary'? This enum already needs to be referred as 'ProfileSummary::ProfileSummaryKind'. I think 'ProfileSummary::Kind' reads a bit better.