This is an archive of the discontinued LLVM Phabricator instance.

[llvm-link] Improve link time for bitcode archives [NFC]
ClosedPublic

Authored by sdmitriev on Jan 13 2021, 6:22 PM.

Details

Summary

Linking large bitcode archives currently takes a lot of time with llvm-link,
this patch adds couple improvements which reduce link time for archives

  • Use one Linker instance for archive instead of recreating it for each member
  • Lazy load archive members

Diff Detail

Event Timeline

sdmitriev requested review of this revision.Jan 13 2021, 6:22 PM
sdmitriev created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 13 2021, 6:22 PM
tra added a comment.Jan 14 2021, 10:51 AM

LGTM.

Do you have any measurements showing actual impact on performance or memory consumption?

llvm/tools/llvm-link/llvm-link.cpp
149

This should be moved closer to the point where it's used.

sdmitriev updated this revision to Diff 316817.Jan 14 2021, 5:26 PM

Addressed review comment.

In D94643#2498870, @tra wrote:

LGTM.

Do you have any measurements showing actual impact on performance or memory consumption?

On my local experiments with a big bitcode library link time reduced from ~10 minutes to ~9 seconds.

sdmitriev marked an inline comment as done.Jan 14 2021, 5:43 PM
jdoerfert accepted this revision.Jan 19 2021, 7:58 AM

@tra accepted. LGTM too.

This revision is now accepted and ready to land.Jan 19 2021, 7:58 AM
tra accepted this revision.Jan 19 2021, 10:28 AM