diff options
| author | Teresa Johnson <tejohnson@google.com> | 2018-02-06 00:43:39 +0000 |
|---|---|---|
| committer | Teresa Johnson <tejohnson@google.com> | 2018-02-06 00:43:39 +0000 |
| commit | 791c98e4c82bcaa245c9b57e5d0de1cf1a16e182 (patch) | |
| tree | 840c676d316c8a68a2c04c2a6866fc7113be8dd0 /llvm/test/tools | |
| parent | 7b98be2c192ceeccd18daafb5129400866ff5188 (diff) | |
| download | bcm5719-llvm-791c98e4c82bcaa245c9b57e5d0de1cf1a16e182.tar.gz bcm5719-llvm-791c98e4c82bcaa245c9b57e5d0de1cf1a16e182.zip | |
[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
llvm-svn: 324299
Diffstat (limited to 'llvm/test/tools')
| -rw-r--r-- | llvm/test/tools/gold/X86/global_with_section.ll | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/test/tools/gold/X86/global_with_section.ll b/llvm/test/tools/gold/X86/global_with_section.ll index 8ea4246c49c..2ba0a16e237 100644 --- a/llvm/test/tools/gold/X86/global_with_section.ll +++ b/llvm/test/tools/gold/X86/global_with_section.ll @@ -47,7 +47,7 @@ target triple = "x86_64-unknown-linux-gnu" ; the expected internalization. ; CHECK-REGULARLTO-DAG: @var_with_nonC_section = internal global i32 0, section ".nonCsection" ; Check we dropped definition of dead variable. -; CHECK-THINLTO-DAG: @var_with_nonC_section = external dso_local global i32, section ".nonCsection" +; CHECK-THINLTO-NOT: @var_with_nonC_section @var_with_nonC_section = global i32 0, section ".nonCsection" ; We should not internalize @deadfunc_with_section due to section @@ -61,7 +61,7 @@ define void @deadfunc_with_section() section "some_other_section" { ; the expected internalization. ; CHECK2-REGULARLTO-DAG: define internal void @deadfunc_with_nonC_section() section ".nonCsection" ; Check dead function converted to declaration. -; CHECK-THINLTO-DAG: declare dso_local void @deadfunc_with_nonC_section() section ".nonCsection" +; CHECK-THINLTO-NOT: @deadfunc_with_nonC_section() define void @deadfunc_with_nonC_section() section ".nonCsection" { call void @deadfunc2_called_from_nonC_section() ret void @@ -80,5 +80,5 @@ declare void @deadfunc2_called_from_section() ; are getting the expected internalization. ; CHECK2-REGULARLTO: define internal void @deadfunc2_called_from_nonC_section ; Check dead function converted to declaration. -; CHECK2-THINLTO: declare dso_local void @deadfunc2_called_from_nonC_section +; CHECK2-THINLTO-NOT: @deadfunc2_called_from_nonC_section declare void @deadfunc2_called_from_nonC_section() |

