aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2017-01-05 21:34:18 +0000
committerTeresa Johnson <tejohnson@google.com>2017-01-05 21:34:18 +0000
commit6c475a75953811bd14b115f5ab88d61ec996a799 (patch)
tree33245462e72aa549f6fd059ad6dd5f4ba0de6b5f /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent8f05c786c9996b82055358289c7d2f4c748a21c6 (diff)
downloadllvm-6c475a75953811bd14b115f5ab88d61ec996a799.zip
llvm-6c475a75953811bd14b115f5ab88d61ec996a799.tar.gz
llvm-6c475a75953811bd14b115f5ab88d61ec996a799.tar.bz2
ThinLTO: add early "dead-stripping" on the Index
Summary: Using the linker-supplied list of "preserved" symbols, we can compute the list of "dead" symbols, i.e. the one that are not reachable from a "preserved" symbol transitively on the reference graph. Right now we are using this information to mark these functions as non-eligible for import. The impact is two folds: - Reduction of compile time: we don't import these functions anywhere or import the function these symbols are calling. - The limited number of import/export leads to better internalization. Patch originally by Mehdi Amini. Reviewers: mehdi_amini, pcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23488 llvm-svn: 291177
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 19a8e24..ebb2022 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -972,6 +972,7 @@ static uint64_t getEncodedGVSummaryFlags(GlobalValueSummary::GVFlags Flags) {
uint64_t RawFlags = 0;
RawFlags |= Flags.NotEligibleToImport; // bool
+ RawFlags |= (Flags.LiveRoot << 1);
// Linkage don't need to be remapped at that time for the summary. Any future
// change to the getEncodedLinkage() function will need to be taken into
// account here as well.