This is an archive of the discontinued LLVM Phabricator instance.

Inline initOffsetMap
ClosedPublic

Authored by espindola on Apr 3 2018, 10:21 AM.

Details

Reviewers
ruiu
Summary

In the lld perf builder 328686 had a negative impact in stalled-cycles-frontend. Somehow that stat is not showing on my machine, but the attached patch shows an improvement on cache-misses, which is probably a reasonable proxy.

My working theory is that given a large input the pieces vector is out of cache by the time initOffsetMap runs.

Both finalizeContents implementation have a convenient location for initializing the OffsetMap, so this seems the best solution.

Diff Detail

Event Timeline

espindola created this revision.Apr 3 2018, 10:21 AM
ruiu added inline comments.Apr 3 2018, 10:24 AM
ELF/SyntheticSections.cpp
2445

Shouldn't this line be in the following if?

espindola added inline comments.Apr 3 2018, 11:02 AM
ELF/SyntheticSections.cpp
2445

No, we want the map to include dead pieces so that we can find that they are dead without a binary search.

That was the case before this patch too.

ruiu accepted this revision.Apr 3 2018, 12:43 PM

LGTM

This revision is now accepted and ready to land.Apr 3 2018, 12:43 PM