[lld] r301438 - LTO: Mark undefined module asm symbols as used.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 26 10:53:39 PDT 2017


Author: pcc
Date: Wed Apr 26 12:53:39 2017
New Revision: 301438

URL: http://llvm.org/viewvc/llvm-project?rev=301438&view=rev
Log:
LTO: Mark undefined module asm symbols as used.

Marking them as used causes them to be considered visible outside of LTO. This
prevents the symbols from being internalized or discarded, either by GlobalDCE
or by summary-based dead stripping in ThinLTO.

This change makes it unnecessary to add these symbols to llvm.compiler.used
in the backend, as the symbols are kept alive by virtue of being external,
so remove the backend code that handles that.

Fixes PR32798.

Differential Revision: https://reviews.llvm.org/D32544

Modified:
    lld/trunk/test/ELF/lto/asmundef.ll

Modified: lld/trunk/test/ELF/lto/asmundef.ll
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto/asmundef.ll?rev=301438&r1=301437&r2=301438&view=diff
==============================================================================
--- lld/trunk/test/ELF/lto/asmundef.ll (original)
+++ lld/trunk/test/ELF/lto/asmundef.ll Wed Apr 26 12:53:39 2017
@@ -20,6 +20,5 @@ define void @_start() {
   ret void
 }
 
-; CHECK: @llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @foo to i8*)], section "llvm.metadata"
-; CHECK: define internal void @foo
+; CHECK: define void @foo
 




More information about the llvm-commits mailing list