[llvm] r266281 - ThinLTO: linkonce compile-time optimization, do not bother when there is only one input file

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 14 01:46:22 PDT 2016


Author: mehdi_amini
Date: Thu Apr 14 03:46:22 2016
New Revision: 266281

URL: http://llvm.org/viewvc/llvm-project?rev=266281&view=rev
Log:
ThinLTO: linkonce compile-time optimization, do not bother when there is only one input file

From: Mehdi Amini <mehdi.amini at apple.com>

Modified:
    llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp

Modified: llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp?rev=266281&r1=266280&r2=266281&view=diff
==============================================================================
--- llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp (original)
+++ llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp Thu Apr 14 03:46:22 2016
@@ -173,6 +173,10 @@ static void ResolveODR(GlobalValue &GV,
 /// 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.




More information about the llvm-commits mailing list