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

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 27 08:27:25 PDT 2017


On 26 April 2017 at 13:53, Peter Collingbourne via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> 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

This is a small code quality regression. Before we had an internal GV
that we knew we had to keep. Now we have an external GV.

Would it be too hard to get it back?

Cheers,
Rafael


More information about the llvm-commits mailing list