]> granicus.if.org Git - llvm/commit
[Remarks] Add an LLVM-bitstream-based remark serializer
authorFrancis Visoiu Mistrih <francisvm@yahoo.com>
Tue, 30 Jul 2019 23:11:57 +0000 (23:11 +0000)
committerFrancis Visoiu Mistrih <francisvm@yahoo.com>
Tue, 30 Jul 2019 23:11:57 +0000 (23:11 +0000)
commit6038bea1b86bb73ac6d080b11db07813e4593678
treec95536d7ebb3c5f503776afec07b3adfa8e92500
parent2f158d66cf167c42479cb7943d056fb828fb9fcd
[Remarks] Add an LLVM-bitstream-based remark serializer

Add a new serializer, using a binary format based on the LLVM bitstream
format.

This format provides a way to serialize the remarks in two modes:

1) Separate mode: the metadata is separate from the remark entries.
2) Standalone mode: the metadata and the remark entries are in the same
file.

The format contains:

* a meta block: container version, container type, string table,
external file path, remark version
* a remark block: type, remark name, pass name, function name, debug
file, debug line, debug column, hotness, arguments (key, value, debug
file, debug line, debug column)

A string table is required for this format, which will be dumped in the
meta block to be consumed before parsing the remark blocks.

On clang itself, we noticed a size reduction of 13.4x compared to YAML,
and a compile-time reduction of between 1.7% and 3.5% on CTMark.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367364 91177308-0d34-0410-b5e6-96231b3b80d8
20 files changed:
docs/Remarks.rst
include/llvm/Bitcode/BitcodeAnalyzer.h
include/llvm/Remarks/BitstreamRemarkContainer.h [new file with mode: 0644]
include/llvm/Remarks/BitstreamRemarkSerializer.h [new file with mode: 0644]
include/llvm/Remarks/Remark.h
include/llvm/Remarks/RemarkFormat.h
lib/Bitcode/Reader/BitcodeAnalyzer.cpp
lib/IR/RemarkStreamer.cpp
lib/Remarks/BitstreamRemarkSerializer.cpp [new file with mode: 0644]
lib/Remarks/CMakeLists.txt
lib/Remarks/RemarkFormat.cpp
lib/Remarks/RemarkParser.cpp
lib/Remarks/RemarkSerializer.cpp
lib/Remarks/YAMLRemarkParser.cpp
lib/Remarks/YAMLRemarkSerializer.cpp
test/Bitcode/stream-types.c
test/Bitcode/stream-types.c.opt.bitstream [new file with mode: 0644]
unittests/Remarks/BitstreamRemarksFormatTest.cpp [new file with mode: 0644]
unittests/Remarks/BitstreamRemarksSerializerTest.cpp [new file with mode: 0644]
unittests/Remarks/CMakeLists.txt