This is an archive of the discontinued LLVM Phabricator instance.

Do not split mergeable sections if they are gc'ed.
ClosedPublic

Authored by ruiu on May 22 2016, 6:05 PM.

Details

Summary

Previously, mergeable section's constructors did more than just
setting member variables; it split section contents into small
pieces. It is not always computationally cheap task because if
the section is a mergeable string section, it needs to scan the
entire section to split them by NUL characters.

If a section would be thrown away by GC, that cost ended up
being a waste of time. It is going to be larger problem if the
section is compressed -- the whole time to uncompress it and
split it up is going to be a waste.

Luckily, we can defer section splitting after GC. We just have
to remember which offsets are in use during GC and apply that later.
This patch implements it.

Diff Detail

Repository
rL LLVM

Event Timeline

ruiu updated this revision to Diff 58066.May 22 2016, 6:05 PM
ruiu retitled this revision from to Do not split mergeable sections if they are gc'ed..
ruiu updated this object.
ruiu added a reviewer: grimar.
ruiu added a subscriber: llvm-commits.
ruiu updated this revision to Diff 58067.May 22 2016, 6:09 PM

Removed unrelated changes.

grimar accepted this revision.May 23 2016, 1:05 AM
grimar edited edge metadata.

(for history)
my opinion about this was here: D20433

This revision is now accepted and ready to land.May 23 2016, 1:05 AM
This revision was automatically updated to reflect the committed changes.