This is an archive of the discontinued LLVM Phabricator instance.

GlobalDCE: Improve performance for large modules containing comdats.
ClosedPublic

Authored by pcc on Mar 18 2015, 6:00 PM.

Details

Summary

When we encounter a global with a comdat, rather than iterating over
every global in the module to find globals in the same comdat, store the
members in a multimap. This effectively lowers the complexity to O(N log N),
improving performance significantly for large modules such as might be
encountered during LTO.

It looks like we used to do something like this until r219191.

Diff Detail

Repository
rL LLVM

Event Timeline

pcc updated this revision to Diff 22235.Mar 18 2015, 6:00 PM
pcc retitled this revision from to GlobalDCE: Improve performance for large modules containing comdats..
pcc updated this object.
pcc edited the test plan for this revision. (Show Details)
pcc added reviewers: majnemer, chandlerc.
pcc added subscribers: kcc, Unknown Object (MLST).
rafael accepted this revision.Mar 19 2015, 8:38 AM
rafael added a reviewer: rafael.
rafael added a subscriber: rafael.

LGTM with a suggestion.

lib/Transforms/IPO/GlobalDCE.cpp
50 ↗(On Diff #22235)

Would unordered_multimap be any better?

This revision is now accepted and ready to land.Mar 19 2015, 8:38 AM
This revision was automatically updated to reflect the committed changes.
pcc added inline comments.Mar 19 2015, 11:28 AM
lib/Transforms/IPO/GlobalDCE.cpp
50 ↗(On Diff #22235)

Marginally, according to profiling, but it might be noise.