summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/WholeProgramDevirt
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2019-05-10 20:08:24 +0000
committerTeresa Johnson <tejohnson@google.com>2019-05-10 20:08:24 +0000
commit37b80122bd1225eb8889d42b4fd5d7d383a329e7 (patch)
tree6ccf622e3818974d1cb31b009f828f959bd333a9 /llvm/test/Transforms/WholeProgramDevirt
parentbcb9bbc01122a3386ac2e321f8b505b1fb246298 (diff)
downloadbcm5719-llvm-37b80122bd1225eb8889d42b4fd5d7d383a329e7.tar.gz
bcm5719-llvm-37b80122bd1225eb8889d42b4fd5d7d383a329e7.zip
[ThinLTO] Auto-hide prevailing linkonce_odr only when all copies eligible
Summary: We hit undefined references building with ThinLTO when one source file contained explicit instantiations of a template method (weak_odr) but there were also implicit instantiations in another file (linkonce_odr), and the latter was the prevailing copy. In this case the symbol was marked hidden when the prevailing linkonce_odr copy was promoted to weak_odr. It led to unsats when the resulting shared library was linked with other code that contained a reference (expecting to be resolved due to the explicit instantiation). Add a CanAutoHide flag to the GV summary to allow the thin link to identify when all copies are eligible for auto-hiding (because they were all originally linkonce_odr global unnamed addr), and only do the auto-hide in that case. Most of the changes here are due to plumbing the new flag through the bitcode and llvm assembly, and resulting test changes. I augmented the existing auto-hide test to check for this situation. Reviewers: pcc Subscribers: mehdi_amini, inglorion, eraman, dexonsmith, arphaman, dang, llvm-commits, steven_wu, wmi Tags: #llvm Differential Revision: https://reviews.llvm.org/D59709 llvm-svn: 360466
Diffstat (limited to 'llvm/test/Transforms/WholeProgramDevirt')
-rw-r--r--llvm/test/Transforms/WholeProgramDevirt/import-indir.ll1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/test/Transforms/WholeProgramDevirt/import-indir.ll b/llvm/test/Transforms/WholeProgramDevirt/import-indir.ll
index 927ee16b370..5c2be7d8629 100644
--- a/llvm/test/Transforms/WholeProgramDevirt/import-indir.ll
+++ b/llvm/test/Transforms/WholeProgramDevirt/import-indir.ll
@@ -8,6 +8,7 @@
; SUMMARY-NEXT: NotEligibleToImport: false
; SUMMARY-NEXT: Live: true
; SUMMARY-NEXT: Local: false
+; SUMMARY-NEXT: CanAutoHide: false
; SUMMARY-NEXT: TypeTestAssumeVCalls:
; SUMMARY-NEXT: - GUID: 123
; SUMMARY-NEXT: Offset: 0
OpenPOWER on IntegriCloud