This is an archive of the discontinued LLVM Phabricator instance.

ELF: Add "fast link" mode.
ClosedPublic

Authored by ruiu on Apr 28 2016, 6:27 PM.

Details

Summary

I'm not 100% sure if this is the right thing to do, but at least
it seems to be worth discussing. This patch adds a new command line
flag, --fast, to the linker. That flag disables costly but optional
features so that the linker produces semantically correct (but larger)
output quickly. Currently it only disables section merging.

This flag is not intended to be used for final production linking.
It is intended to be used in compile-link-test cycle.

Time to link clang with debug info is about 2x faster with the flag.

Head:
13.24 seconds
Output size: 1227189664 bytes

With this patch:
7.41 seconds
Output size: 2490281784 bytes

Diff Detail

Repository
rL LLVM

Event Timeline

ruiu updated this revision to Diff 55519.Apr 28 2016, 6:27 PM
ruiu retitled this revision from to ELF: Add "fast link" mode..
ruiu updated this object.
ruiu added a reviewer: rafael.
ruiu added a subscriber: llvm-commits.
davide added a subscriber: davide.Apr 28 2016, 7:15 PM

Can't -O be used for that?

ruiu added a comment.Apr 28 2016, 7:21 PM

Maybe we can, but this should be one below the default optimization level. So maybe we should define -O1 as default and -O0 as this? Then I think "O" makes sense.

That was exactly what we had in mind. The set of optimizations performed by a linker is relatively small compared to the optimizations done by a compiler so I don't think we'll have hard time deciding what we want to put at any given level.

Cheers

That was exactly what we had in mind. The set of optimizations performed by a linker is relatively small compared to the optimizations done by a compiler so I don't think we'll have hard time deciding what we want to put at any given level.

Cheers

*I had in mind.

ruiu updated this revision to Diff 55522.Apr 28 2016, 7:27 PM
  • Update as per Davide's comment.
davide accepted this revision.Apr 28 2016, 7:29 PM
davide added a reviewer: davide.

I think this is good, and I like that. Hopefully other people will share this feeling.

This revision is now accepted and ready to land.Apr 28 2016, 7:29 PM
ruiu added a comment.Apr 28 2016, 7:35 PM

Yeah, this is better than I originally thought. I like it.

rafael accepted this revision.Apr 29 2016, 3:59 AM
rafael edited edge metadata.

LGTM with a testcaste :-)

This revision was automatically updated to reflect the committed changes.