OSDN Git Service

[ThinLTO] Remove dead and dropped symbol declarations when possible
authorTeresa Johnson <tejohnson@google.com>
Tue, 6 Feb 2018 00:43:39 +0000 (00:43 +0000)
committerTeresa Johnson <tejohnson@google.com>
Tue, 6 Feb 2018 00:43:39 +0000 (00:43 +0000)
commitdfa5766c55dec7212ba0b8d08b2ce3b4cc31037d
tree41f2e9cf7df5b5044b4403be71eb34b8b4aca0dc
parent41600e64fdc12e8235917f3bc1eb40750cc57ee4
[ThinLTO] Remove dead and dropped symbol declarations when possible

Summary:
Removing the dropped symbols will prevent indirect call promotion in the
ThinLTO Backend from adding a new reference to a symbol, which can
result in linker unsats. This can happen when we compile with a sample
profile collected from one binary by used for another, which may have
profiled targets that aren't used in the new binary.

Note that until dropDeadSymbols handles variables and aliases (in
progress), we may not be able to remove the declaration and can still
have an issue.

Reviewers: grimar, davidxl

Subscribers: mehdi_amini, inglorion, llvm-commits, eraman

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324299 91177308-0d34-0410-b5e6-96231b3b80d8
lib/LTO/LTOBackend.cpp
test/ThinLTO/X86/deadstrip.ll
test/Transforms/PGOProfile/thinlto_samplepgo_icp_droppeddead.ll [new file with mode: 0644]
test/tools/gold/X86/global_with_section.ll