diff options
author | Eugene Leviant <eleviant@accesssoftek.com> | 2019-07-05 13:26:05 +0000 |
---|---|---|
committer | Eugene Leviant <eleviant@accesssoftek.com> | 2019-07-05 13:26:05 +0000 |
commit | e91f86f0ac70be2bfcb3fb862b4e6d9d9f84cf5f (patch) | |
tree | f5d1b66d575ed369304540880d3e1bed3a6ac194 /llvm/lib/Transforms/IPO/FunctionImport.cpp | |
parent | 8ca1c65cedb0b86c9706b5ec1a962d80f48af434 (diff) | |
download | bcm5719-llvm-e91f86f0ac70be2bfcb3fb862b4e6d9d9f84cf5f.tar.gz bcm5719-llvm-e91f86f0ac70be2bfcb3fb862b4e6d9d9f84cf5f.zip |
Reverted r365188 due to alignment problems on i686-android
llvm-svn: 365206
Diffstat (limited to 'llvm/lib/Transforms/IPO/FunctionImport.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/FunctionImport.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp index 62c7fbd0722..9207f5fe0ef 100644 --- a/llvm/lib/Transforms/IPO/FunctionImport.cpp +++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp @@ -850,16 +850,14 @@ void llvm::computeDeadSymbolsWithConstProp( bool ImportEnabled) { computeDeadSymbols(Index, GUIDPreservedSymbols, isPrevailing); if (ImportEnabled) { - Index.propagateAttributes(GUIDPreservedSymbols); + Index.propagateConstants(GUIDPreservedSymbols); } else { - // If import is disabled we should drop read/write-only attribute + // If import is disabled we should drop read-only attribute // from all summaries to prevent internalization. for (auto &P : Index) for (auto &S : P.second.SummaryList) - if (auto *GVS = dyn_cast<GlobalVarSummary>(S.get())) { + if (auto *GVS = dyn_cast<GlobalVarSummary>(S.get())) GVS->setReadOnly(false); - GVS->setWriteOnly(false); - } } } @@ -1066,7 +1064,7 @@ static Function *replaceAliasWithAliasee(Module *SrcModule, GlobalAlias *GA) { // Internalize values that we marked with specific attribute // in processGlobalForThinLTO. -static void internalizeGVsAfterImport(Module &M) { +static void internalizeImmutableGVs(Module &M) { for (auto &GV : M.globals()) // Skip GVs which have been converted to declarations // by dropDeadSymbols. @@ -1199,7 +1197,7 @@ Expected<bool> FunctionImporter::importFunctions( NumImportedModules++; } - internalizeGVsAfterImport(DestModule); + internalizeImmutableGVs(DestModule); NumImportedFunctions += (ImportedCount - ImportedGVCount); NumImportedGlobalVars += ImportedGVCount; |