[PATCH] D23632: [LTO] Promote before performing weak resolution

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 17 18:07:35 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL279021: [LTO] Promote before performing weak resolution (authored by mehdi_amini).

Changed prior to commit:
  https://reviews.llvm.org/D23632?vs=68439&id=68469#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D23632

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

Index: llvm/trunk/test/ThinLTO/X86/internalize.ll
===================================================================
--- llvm/trunk/test/ThinLTO/X86/internalize.ll
+++ llvm/trunk/test/ThinLTO/X86/internalize.ll
@@ -3,17 +3,30 @@
 ; RUN: llvm-lto -thinlto-action=internalize -thinlto-index %t.index.bc %t1.bc -o - | llvm-dis -o - | FileCheck %s --check-prefix=REGULAR
 ; RUN: llvm-lto -thinlto-action=internalize -thinlto-index %t.index.bc %t1.bc -o -  --exported-symbol=foo | llvm-dis -o - | FileCheck %s --check-prefix=INTERNALIZE
 
+; RUN: llvm-lto2 %t1.bc -o %t.o -save-temps \
+; RUN:     -r=%t1.bc,_foo,pxl \
+; RUN:     -r=%t1.bc,_bar,pl \
+; RUN:     -r=%t1.bc,_linkonce_func,pl
+; RUN: llvm-dis < %t.o.1.2.internalize.bc | FileCheck  %s --check-prefix=INTERNALIZE
+
+
 ; REGULAR: define void @foo
 ; REGULAR: define void @bar
+; REGULAR: define linkonce void @linkonce_func()
 ; INTERNALIZE: define void @foo
 ; INTERNALIZE: define internal void @bar
+; INTERNALIZE: define internal void @linkonce_func()
 
 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-apple-macosx10.11.0"
 
 define void @foo() {
     ret void
 }
 define void @bar() {
+    call void @linkonce_func()
+	ret void
+}
+define linkonce void @linkonce_func() {
     ret void
 }
\ No newline at end of file
Index: llvm/trunk/lib/LTO/LTOBackend.cpp
===================================================================
--- llvm/trunk/lib/LTO/LTOBackend.cpp
+++ llvm/trunk/lib/LTO/LTOBackend.cpp
@@ -250,10 +250,10 @@
   if (Conf.PreOptModuleHook && !Conf.PreOptModuleHook(Task, Mod))
     return Error();
 
-  thinLTOResolveWeakForLinkerModule(Mod, DefinedGlobals);
-
   renameModuleForThinLTO(Mod, CombinedIndex);
 
+  thinLTOResolveWeakForLinkerModule(Mod, DefinedGlobals);
+
   if (Conf.PostPromoteModuleHook && !Conf.PostPromoteModuleHook(Task, Mod))
     return Error();
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23632.68469.patch
Type: text/x-patch
Size: 1886 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160818/74c2aed8/attachment.bin>


More information about the llvm-commits mailing list