This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Stop using SectionKey for creating output sections.
ClosedPublic

Authored by grimar on Nov 3 2017, 5:57 AM.

Details

Summary

Stop using SectionKey for creating output sections.

Initially SectionKey was designed because we merged section with
use of Flags and Alignment fields. Currently LLD merges them by name only,
except the case when -relocatable output is produced. In that case
we still merge sections only with the same flags and alignment.
There is probably no issue at all to stop using Flags and Alignment for -r and
just disable the merging in that case.

After doing that change we can get rid of using SectionKey. That is not only
simplifies the code, but also gives perfomance boost.
I tried to link chrome (used set of objects from lld-speed-test archive shared
by Rafael earlier) and results are next:

  • Without patch: 1,666750355 seconds time elapsed ( +-0,10% )
  • With patch: 1,551585364 seconds time elapsed ( +-0,12% )

That looks to be 7% difference..

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.Nov 3 2017, 5:57 AM
grimar edited the summary of this revision. (Show Details)Nov 3 2017, 5:58 AM
ruiu accepted this revision.Nov 3 2017, 1:39 PM

LGTM

This is very nice improvement. The 7% improvement you observed feels a bit too good, and I'm not sure if it is applicable to other test cases, but this patch itself is pretty nice.

This revision is now accepted and ready to land.Nov 3 2017, 1:39 PM
grimar added a comment.Nov 4 2017, 2:01 AM
In D39594#915573, @ruiu wrote:

LGTM

This is very nice improvement. The 7% improvement you observed feels a bit too good, and I'm not sure if it is applicable to other test cases, but this patch itself is pretty nice.

Yeah I have the same feelings. 7% is too good to be true for general case, I tried to link mozilla today and time goes
from 3,210261947 seconds ( +- 0,06% ) to 3,153782940 seconds ( +- 0,06% ) for me, it is about 2%, still a nice time bonus for cleanup change.

This revision was automatically updated to reflect the committed changes.