diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2017-04-26 17:53:39 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2017-04-26 17:53:39 +0000 |
commit | fa58f7528e81c1a6d055cd93efe2a2f0364e0a3d (patch) | |
tree | f4126113b71764527f836220c52235eb39bc7e49 /llvm/test/LTO/Resolution | |
parent | c9f0a4f1eccf55c1f588c8d7e966c677a1baf781 (diff) | |
download | bcm5719-llvm-fa58f7528e81c1a6d055cd93efe2a2f0364e0a3d.tar.gz bcm5719-llvm-fa58f7528e81c1a6d055cd93efe2a2f0364e0a3d.zip |
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
llvm-svn: 301438
Diffstat (limited to 'llvm/test/LTO/Resolution')
-rw-r--r-- | llvm/test/LTO/Resolution/X86/Inputs/mod-asm-used.ll | 4 | ||||
-rw-r--r-- | llvm/test/LTO/Resolution/X86/mod-asm-used.ll | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/llvm/test/LTO/Resolution/X86/Inputs/mod-asm-used.ll b/llvm/test/LTO/Resolution/X86/Inputs/mod-asm-used.ll new file mode 100644 index 00000000000..3b1988bb54d --- /dev/null +++ b/llvm/test/LTO/Resolution/X86/Inputs/mod-asm-used.ll @@ -0,0 +1,4 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@foo = global i32 1, align 4 diff --git a/llvm/test/LTO/Resolution/X86/mod-asm-used.ll b/llvm/test/LTO/Resolution/X86/mod-asm-used.ll new file mode 100644 index 00000000000..01befca84d0 --- /dev/null +++ b/llvm/test/LTO/Resolution/X86/mod-asm-used.ll @@ -0,0 +1,10 @@ +; RUN: opt -module-summary -o %t.bc %s +; RUN: opt -module-summary -o %t2.bc %S/Inputs/mod-asm-used.ll +; RUN: llvm-lto2 run %t.bc -r %t.bc,foo,l %t2.bc -r %t2.bc,foo,pl -o %t3 +; RUN: llvm-nm %t3.1 | FileCheck %s + +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +; CHECK: D foo +module asm ".quad foo" |