diff options
author | Eugene Leviant <eleviant@accesssoftek.com> | 2019-07-05 15:25:05 +0000 |
---|---|---|
committer | Eugene Leviant <eleviant@accesssoftek.com> | 2019-07-05 15:25:05 +0000 |
commit | 3aef35288b5387d3b1e8c1627df5c031b9c151c7 (patch) | |
tree | a234bcaa1bd15f5170446186728e3fdd89a69159 /llvm/lib/Transforms/IPO/FunctionImport.cpp | |
parent | 47afdaa4872e8617734e50bcc99bab149bfb08f8 (diff) | |
download | bcm5719-llvm-3aef35288b5387d3b1e8c1627df5c031b9c151c7.tar.gz bcm5719-llvm-3aef35288b5387d3b1e8c1627df5c031b9c151c7.zip |
[ThinLTO] Attempt to recommit r365188 after alignment fix
llvm-svn: 365215
Diffstat (limited to 'llvm/lib/Transforms/IPO/FunctionImport.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/FunctionImport.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp index 9207f5fe0ef..62c7fbd0722 100644 --- a/llvm/lib/Transforms/IPO/FunctionImport.cpp +++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp @@ -850,14 +850,16 @@ void llvm::computeDeadSymbolsWithConstProp( bool ImportEnabled) { computeDeadSymbols(Index, GUIDPreservedSymbols, isPrevailing); if (ImportEnabled) { - Index.propagateConstants(GUIDPreservedSymbols); + Index.propagateAttributes(GUIDPreservedSymbols); } else { - // If import is disabled we should drop read-only attribute + // If import is disabled we should drop read/write-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); + } } } @@ -1064,7 +1066,7 @@ static Function *replaceAliasWithAliasee(Module *SrcModule, GlobalAlias *GA) { // Internalize values that we marked with specific attribute // in processGlobalForThinLTO. -static void internalizeImmutableGVs(Module &M) { +static void internalizeGVsAfterImport(Module &M) { for (auto &GV : M.globals()) // Skip GVs which have been converted to declarations // by dropDeadSymbols. @@ -1197,7 +1199,7 @@ Expected<bool> FunctionImporter::importFunctions( NumImportedModules++; } - internalizeImmutableGVs(DestModule); + internalizeGVsAfterImport(DestModule); NumImportedFunctions += (ImportedCount - ImportedGVCount); NumImportedGlobalVars += ImportedGVCount; |