llvm-project/llvm/lib/Bitcode/Writer
Jianzhou Zhao 11201315d5 Flush bitcode incrementally for LTO output
Bitcode writer does not flush buffer until the end by default. This is
fine to small bitcode files. When -flto,--plugin-opt=emit-llvm,-gmlt are
used, the final bitcode file is large, for example, >8G. Keeping all
data in memory consumes a lot of memory.

This change allows bitcode writer flush data to disk early when buffered
data size is above some threshold. This is only enabled when lld emits
LLVM bitcode.

One issue to address is backpatching bitcode: subblock length, function
body indexes, meta data indexes need to backfill. If buffer can be
flushed partially, we introduced raw_fd_stream that supports
read/seek/write, and enables backpatching bitcode flushed in disk.

Reviewed-by: tejohnson, MaskRay

Differential Revision: https://reviews.llvm.org/D86905
2020-09-17 03:32:31 +00:00
..
BitWriter.cpp Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC 2019-08-05 05:43:48 +00:00
BitcodeWriter.cpp Flush bitcode incrementally for LTO output 2020-09-17 03:32:31 +00:00
BitcodeWriterPass.cpp Revert "Move ModuleSummaryAnalysis from libAnalysis to libObject to break the dependency from Analysis to Object" 2020-04-14 00:27:08 +00:00
CMakeLists.txt [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ValueEnumerator.cpp ValueEnumerator.cpp - remove duplicate includes. NFCI. 2020-09-16 18:32:28 +01:00
ValueEnumerator.h ValueEnumerator.h - remove unnecessary includes. NFC. 2020-04-24 16:21:38 +01:00