This is an archive of the discontinued LLVM Phabricator instance.

[BOLT] Speedup symbol table sort
ClosedPublic

Authored by maksfb on Sep 17 2023, 1:08 PM.

Details

Summary

Memoize SymbolRef::getAddress() for sorting symbol table entries by
their address. Saves about 10 seconds of processing time on large
binaries with over 2 million symbols. NFCI.

Diff Detail

Event Timeline

maksfb created this revision.Sep 17 2023, 1:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 17 2023, 1:08 PM
Herald added a subscriber: treapster. · View Herald Transcript
maksfb requested review of this revision.Sep 17 2023, 1:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 17 2023, 1:08 PM
jobnoorman accepted this revision.Sep 18 2023, 12:59 AM
jobnoorman added inline comments.
bolt/lib/Rewrite/RewriteInstance.cpp
820

emplace_back?

This revision is now accepted and ready to land.Sep 18 2023, 12:59 AM
Amir accepted this revision.Sep 18 2023, 10:30 AM
This revision was automatically updated to reflect the committed changes.
maksfb marked an inline comment as done.Sep 18 2023, 11:30 AM
maksfb added inline comments.
bolt/lib/Rewrite/RewriteInstance.cpp
820

Doesn't work with structs.