This is an archive of the discontinued LLVM Phabricator instance.

Split merge sections early
ClosedPublic

Authored by espindola on Apr 26 2018, 8:05 PM.

Details

Reviewers
ruiu
grimar
Summary

Now that getSectionPiece is fast (uses a hash) it is probably OK to split merge sections early.

The reason I want to do this is to split eh_frame sections in the same place.

This does mean that we have to decompress early. Given that the only compressed sections are debug info, I don't think we are missing much.

It is a small improvement: 0.5% geometric mean.

Diff Detail

Event Timeline

espindola created this revision.Apr 26 2018, 8:05 PM
espindola edited the summary of this revision. (Show Details)Apr 26 2018, 8:38 PM
grimar accepted this revision.Apr 27 2018, 2:31 AM

I think it is probably OK. What about adding an assert checking that we do decompress only for non-alloc sections?

This revision is now accepted and ready to land.Apr 27 2018, 2:31 AM

I think it is probably OK. What about adding an assert checking that we do decompress only for non-alloc sections?

I don't think an assert is appropriate as we would still do the right thing. If we do get to a point where we are decompressing too much we can revisit this.

ruiu accepted this revision.Apr 27 2018, 8:48 AM

LGTM

ELF/InputSection.h
226–227

I'd remove this function and inline it.

grimar added a comment.EditedApr 27 2018, 8:50 AM

I think it is probably OK. What about adding an assert checking that we do decompress only for non-alloc sections?

I don't think an assert is appropriate as we would still do the right thing. If we do get to a point where we are decompressing too much we can revisit this.

Ok. We would hit this probably if would have compilers that implement the DWARF5 features about multiple debug sections like .debug_info linked with multiple text sections I think.
If those were compressed, calling decompress before marking live sections and dropping unused would be waste.
But there are no such compilers and everybody waiting for new standard afaik.