summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-04-14 08:46:22 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-04-14 08:46:22 +0000
commit8dcc8080ce2f3fed3135766af6b49b98e9b0b2d6 (patch)
tree32882bb4342694c0480e0c25f32640bb977f9665
parent0a3508a8d39746b070f9ad4e3aabe3e0c3fbeed8 (diff)
downloadbcm5719-llvm-8dcc8080ce2f3fed3135766af6b49b98e9b0b2d6.tar.gz
bcm5719-llvm-8dcc8080ce2f3fed3135766af6b49b98e9b0b2d6.zip
ThinLTO: linkonce compile-time optimization, do not bother when there is only one input file
From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266281
-rw-r--r--llvm/lib/LTO/ThinLTOCodeGenerator.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
index fea1c7fb8fa..c9e91eb2202 100644
--- a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
@@ -173,6 +173,10 @@ static void ResolveODR(GlobalValue &GV, const ModuleSummaryIndex &Index,
/// one copy.
static void ResolveODR(Module &TheModule,
const ModuleSummaryIndex &Index) {
+ if (Index.modulePaths().size() == 1)
+ // Nothing to do if we don't have multiple modules
+ return;
+
// We won't optimize the globals that are referenced by an alias for now
// Ideally we should turn the alias into a global and duplicate the definition
// when needed.
OpenPOWER on IntegriCloud