[PATCH] D21917: ThinLTO: Remove check for multiple modules before applying weak resolutions.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 6 18:58:24 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL274722: ThinLTO: Remove check for multiple modules before applying weak resolutions. (authored by pcc).

Changed prior to commit:
  http://reviews.llvm.org/D21917?vs=62991&id=63012#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D21917

Files:
  llvm/trunk/lib/LTO/LTO.cpp
  llvm/trunk/test/ThinLTO/X86/weak_resolution_single.ll

Index: llvm/trunk/lib/LTO/LTO.cpp
===================================================================
--- llvm/trunk/lib/LTO/LTO.cpp
+++ llvm/trunk/lib/LTO/LTO.cpp
@@ -92,10 +92,6 @@
     function_ref<bool(StringRef, GlobalValue::GUID)> isExported,
     function_ref<void(StringRef, GlobalValue::GUID, GlobalValue::LinkageTypes)>
         recordNewLinkage) {
-  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.
Index: llvm/trunk/test/ThinLTO/X86/weak_resolution_single.ll
===================================================================
--- llvm/trunk/test/ThinLTO/X86/weak_resolution_single.ll
+++ llvm/trunk/test/ThinLTO/X86/weak_resolution_single.ll
@@ -0,0 +1,9 @@
+; RUN: opt -module-summary %s -o %t.bc
+; RUN: llvm-lto -thinlto-action=thinlink -o %t2.bc %t.bc
+
+; RUN: llvm-lto -thinlto-action=promote %t.bc -thinlto-index=%t2.bc -exported-symbol=foo -o - | llvm-lto -thinlto-action=internalize -thinlto-module-id=%t.bc - -thinlto-index=%t2.bc -exported-symbol=foo -o - | llvm-dis -o - | FileCheck %s
+
+; CHECK: define weak_odr void @foo()
+define linkonce_odr void @foo() {
+  ret void
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21917.63012.patch
Type: text/x-patch
Size: 1338 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160707/3d057979/attachment.bin>


More information about the llvm-commits mailing list