This is an archive of the discontinued LLVM Phabricator instance.

[CSSPGO] Avoid repeatedly computing md5 hash code for pseudo probe inline contexts.
ClosedPublic

Authored by hoy on Aug 25 2021, 12:00 PM.

Details

Summary

Md5 hashing is expansive. Using a hash map to look up already computed GUID for dwarf names. Saw a 2% build time improvement on an internal large application.

Diff Detail

Event Timeline

hoy created this revision.Aug 25 2021, 12:00 PM
hoy requested review of this revision.Aug 25 2021, 12:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 25 2021, 12:00 PM
hoy retitled this revision from [CSSPGO] Avoid repeatedly compute md5 hash code for pseudo probe inline contexts. to [CSSPGO] Avoid repeatedly computing md5 hash code for pseudo probe inline contexts..
hoy edited the summary of this revision. (Show Details)
wenlei accepted this revision.Aug 29 2021, 9:15 PM

lgtm assuming the test failure is fixed, thanks.

looks like there's indeed room for improvement by replacing md5 with xxhash etc.

llvm/lib/CodeGen/AsmPrinter/PseudoProbePrinter.cpp
40–44

A comment explaining the caching/memoization as a build speed optimization would be helpful.

This revision is now accepted and ready to land.Aug 29 2021, 9:15 PM
hoy updated this revision to Diff 369460.Aug 30 2021, 8:55 AM

Updating D108722: [CSSPGO] Avoid repeatedly computing md5 hash code for pseudo probe inline contexts.

This revision was landed with ongoing or failed builds.Aug 30 2021, 10:12 AM
This revision was automatically updated to reflect the committed changes.