[PATCH] D33813: [ThinLTO] Efficiency improvement when writing module path string table

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 1 17:24:49 PDT 2017


tejohnson created this revision.
Herald added subscribers: inglorion, Prazek.

When writing the combined index, we are walking the entire module
path StringMap in the full index, and checking whether each one should be
included in the index being written. For distributed backends, where we
write an individual combined index for each file, each with only a few
module paths, this is incredibly inefficient. Add a method that takes
a callback and hides the details of whether we are writing the full
combined index, or just a slice, and in the latter case it walks the set
of modules to include instead of the entire index.

For a huge application with around 23K files (i.e. where we were iterating
through the 23K-entry modulePath StringMap 23K times), this change improved
the thin link time by a whopping 48%.


https://reviews.llvm.org/D33813

Files:
  lib/Bitcode/Writer/BitcodeWriter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33813.101142.patch
Type: text/x-patch
Size: 4343 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170602/b04f15f0/attachment.bin>


More information about the llvm-commits mailing list