diff options
author | Teresa Johnson <tejohnson@google.com> | 2016-06-09 01:14:13 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2016-06-09 01:14:13 +0000 |
commit | 7ab1f692720ce4ac024ff5bc0decd69c15389edb (patch) | |
tree | 29f39550f640752991c9af431bc38384947bce87 /llvm/lib/Transforms | |
parent | 1eade9151310d1ca8fd18e932c9af2f8c1ac2f94 (diff) | |
download | bcm5719-llvm-7ab1f692720ce4ac024ff5bc0decd69c15389edb.tar.gz bcm5719-llvm-7ab1f692720ce4ac024ff5bc0decd69c15389edb.zip |
[ThinLTO/gold] Enable summary-based internalization
Summary: Enable existing summary-based importing support in the gold-plugin.
Reviewers: mehdi_amini
Subscribers: llvm-commits, mehdi_amini
Differential Revision: http://reviews.llvm.org/D21080
llvm-svn: 272239
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/IPO/FunctionImport.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp index 3e4cbf520fc..d0b2667369b 100644 --- a/llvm/lib/Transforms/IPO/FunctionImport.cpp +++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp @@ -525,8 +525,19 @@ void llvm::thinLTOInternalizeModule(Module &TheModule, OrigName, GlobalValue::InternalLinkage, TheModule.getSourceFileName()); const auto &GS = DefinedGlobals.find(GlobalValue::getGUID(OrigId)); - assert(GS != DefinedGlobals.end()); - Linkage = GS->second->linkage(); + if (GS == DefinedGlobals.end()) { + // Also check the original non-promoted non-globalized name. In some + // cases a preempted weak value is linked in as a local copy because + // it is referenced by an alias (IRLinker::linkGlobalValueProto). + // In that case, since it was originally not a local value, it was + // recorded in the index using the original name. + // FIXME: This may not be needed once PR27866 is fixed. + const auto &GS = DefinedGlobals.find(GlobalValue::getGUID(OrigName)); + assert(GS != DefinedGlobals.end()); + Linkage = GS->second->linkage(); + } else { + Linkage = GS->second->linkage(); + } } else Linkage = GS->second->linkage(); return !GlobalValue::isLocalLinkage(Linkage); |