diff options
author | Eugene Leviant <eleviant@accesssoftek.com> | 2018-11-16 07:08:00 +0000 |
---|---|---|
committer | Eugene Leviant <eleviant@accesssoftek.com> | 2018-11-16 07:08:00 +0000 |
commit | bf46e7410c8a1d26c4a434261baaae28a904d657 (patch) | |
tree | a8037e2560e4fd3aee808885ae87901c8e857afa /llvm/lib/LTO/LTO.cpp | |
parent | 079c37da5870239d0332870e6c8cea877b335600 (diff) | |
download | llvm-bf46e7410c8a1d26c4a434261baaae28a904d657.zip llvm-bf46e7410c8a1d26c4a434261baaae28a904d657.tar.gz llvm-bf46e7410c8a1d26c4a434261baaae28a904d657.tar.bz2 |
[ThinLTO] Internalize readonly globals
An attempt to recommit r346584 after failure on OSX build bot.
Fixed cache key computation in ThinLTOCodeGenerator and added
test case
llvm-svn: 347033
Diffstat (limited to 'llvm/lib/LTO/LTO.cpp')
-rw-r--r-- | llvm/lib/LTO/LTO.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp index 6b11f69..68fd93a 100644 --- a/llvm/lib/LTO/LTO.cpp +++ b/llvm/lib/LTO/LTO.cpp @@ -187,6 +187,8 @@ static void computeCacheKey( AddUnsigned(VI.isDSOLocal()); AddUsedCfiGlobal(VI.getGUID()); } + if (auto *GVS = dyn_cast<GlobalVarSummary>(GS)) + AddUnsigned(GVS->isReadOnly()); if (auto *FS = dyn_cast<FunctionSummary>(GS)) { for (auto &TT : FS->type_tests()) UsedTypeIds.insert(TT); @@ -809,7 +811,8 @@ Error LTO::run(AddStreamFn AddStream, NativeObjectCache Cache) { return PrevailingType::Unknown; return It->second; }; - computeDeadSymbols(ThinLTO.CombinedIndex, GUIDPreservedSymbols, isPrevailing); + computeDeadSymbolsWithConstProp(ThinLTO.CombinedIndex, GUIDPreservedSymbols, + isPrevailing, Conf.OptLevel > 0); // Setup output file to emit statistics. std::unique_ptr<ToolOutputFile> StatsFile = nullptr; |