]> granicus.if.org Git - llvm/commit
Bitcode: Add a string table to the bitcode format.
authorPeter Collingbourne <peter@pcc.me.uk>
Mon, 17 Apr 2017 17:51:36 +0000 (17:51 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Mon, 17 Apr 2017 17:51:36 +0000 (17:51 +0000)
commit6163b4af732841765908e044f2aa6ea04f1cf989
tree0bae957b5b037fd90e5dee461eda8d5224ff3bff
parent0c79d1f4e07b6b739247705d5779e77cf612a276
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
21 files changed:
docs/BitCodeFormat.rst
include/llvm/Bitcode/BitcodeReader.h
include/llvm/Bitcode/BitcodeWriter.h
include/llvm/Bitcode/LLVMBitCodes.h
lib/Bitcode/Reader/BitcodeReader.cpp
lib/Bitcode/Writer/BitcodeWriter.cpp
lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
test/Bitcode/thinlto-alias.ll
test/Bitcode/thinlto-function-summary-callgraph-pgo.ll
test/Bitcode/thinlto-function-summary-callgraph-profile-summary.ll
test/Bitcode/thinlto-function-summary-callgraph.ll
test/Bitcode/thinlto-function-summary-originalnames.ll
test/Bitcode/thinlto-function-summary-refgraph.ll
test/Bitcode/thinlto-function-summary.ll
test/ThinLTO/X86/autoupgrade.ll
test/ThinLTO/X86/distributed_indexes.ll
test/tools/gold/X86/thinlto.ll
test/tools/llvm-lto/thinlto.ll
tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
tools/llvm-cat/llvm-cat.cpp
tools/llvm-modextract/llvm-modextract.cpp