Commit Graph

5 Commits

Author SHA1 Message Date
Peter Collingbourne
6163b4af73 Bitcode: Add a string table to the bitcode format.
Add a top-level STRTAB block containing a string table blob, and start storing
strings for module codes FUNCTION, GLOBALVAR, ALIAS, IFUNC and COMDAT in
the string table.

This change allows us to share names between globals and comdats as well
as between modules, and improves the efficiency of loading bitcode files by
no longer using a bit encoding for symbol names. Once we start writing the
irsymtab to the bitcode file we will also be able to share strings between
it and the module.

On my machine, link time for Chromium for Linux with ThinLTO decreases by
about 7% for no-op incremental builds or about 1% for full builds. Total
bitcode file size decreases by about 3%.

As discussed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2017-April/111732.html

Differential Revision: https://reviews.llvm.org/D31838

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300464 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-17 17:51:36 +00:00
Vedant Kumar
15d522b811 Avoid some string copies, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299993 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11 22:11:46 +00:00
Peter Collingbourne
06f5b6a274 llvm-cat: Allow bitcode files to be created with no modules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289610 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-13 23:14:55 +00:00
Peter Collingbourne
2a4cea29fc Add missing dependency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288198 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 21:02:19 +00:00
Peter Collingbourne
e6480e2add Bitcode: Introduce BitcodeWriter interface.
This interface allows clients to write multiple modules to a single
bitcode file. Also introduce the llvm-cat utility which can be used
to create a bitcode file containing multiple modules.

Differential Revision: https://reviews.llvm.org/D26179

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288195 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 20:43:47 +00:00