[PATCH] D20516: Do not split mergeable sections if they are gc'ed.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Sun May 22 18:05:31 PDT 2016


ruiu created this revision.
ruiu added a reviewer: grimar.
ruiu added a subscriber: llvm-commits.

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.

http://reviews.llvm.org/D20516

Files:
  ELF/Driver.cpp
  ELF/InputSection.cpp
  ELF/InputSection.h
  ELF/MarkLive.cpp
  ELF/OutputSections.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20516.58066.patch
Type: text/x-patch
Size: 5451 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160523/1aab470c/attachment.bin>


More information about the llvm-commits mailing list