This is an archive of the discontinued LLVM Phabricator instance.

"optimize" the offset computation for SHF_MERGE
Needs ReviewPublic

Authored by • espindola on Oct 19 2015, 2:08 PM.

Details

Reviewers
ruiu
Summary

This uses an extra array so that we only have to do a hash lookup per entry.

Unfortunately, this actually slows down a clang link a bit (from 0.497803521 to 0.499284172 seconds). It looks like at least in clang there are not that many references to SHF_MERGE entries for the extra memory allocation to be beneficial.

We could try allocating the offsets in the end of MergeInputSection, but that seems a bit much for now.

My suggestion would be to revisit this once SHF_STRINGS is implemented.

Diff Detail

Event Timeline

• rafael updated this revision to Diff 37792.Oct 19 2015, 2:08 PM
• rafael retitled this revision from to "optimize" the offset computation for SHF_MERGE.
• rafael updated this object.
• rafael added a reviewer: ruiu.
• rafael added a subscriber: llvm-commits.
ruiu edited edge metadata.Oct 19 2015, 2:14 PM

It's interesting that this patch does not have any performance improvement (or even very slightly negative.) If that's the case, we don't need this patch now.

• espindola commandeered this revision.Mar 15 2018, 8:59 AM
• espindola added a reviewer: • rafael.