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.
Looks fine to me, though I'm not an expert on MD.
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.
s/a MDTuple/an MDTuple/
s/a MDTuple/an MDTuple/. This happens in a couple other places.
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.
In practice, this is going to be of fixed size (the same as DefaultCutoffs). Is SmallVector a better choice instead of std::vector ?