Page MenuHomePhabricator

Please use GitHub pull requests for new patches. Phabricator shutdown timeline

[llvm-profdata] Use StringRef in place of string in FunctionSamplesMap
AbandonedPublic

Authored by huangjd on Jun 6 2023, 4:33 PM.

Details

Summary

Use StringRef instead of a string in FunctionSamplesMap's key type, because all usages of it are backed by the data of a sample profile, or sourced from a function name in the IR. It is necessary to change all usages of string into StringRef inside a SampleProfileMap to implement the 2nd phase of MD5 function name refactoring (by comparing MD5 values directly, instead of changing it to a string first)

Diff Detail

Event Timeline

huangjd created this revision.Jun 6 2023, 4:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2023, 4:33 PM
huangjd requested review of this revision.Jun 6 2023, 4:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2023, 4:33 PM
snehasish accepted this revision.Jun 7 2023, 9:53 AM

lgtm, looks safe to me since the context objects keep a StringRef.

This revision is now accepted and ready to land.Jun 7 2023, 9:53 AM
wenlei accepted this revision.Jun 8 2023, 8:19 PM
wenlei added a subscriber: marksantaniello.

lgtm, thanks. cc @marksantaniello