summaryrefslogtreecommitdiffstats
path: root/llvm/lib/LTO
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2019-10-02 16:36:59 +0000
committerTeresa Johnson <tejohnson@google.com>2019-10-02 16:36:59 +0000
commit077cc3fcb01d2a38d2591b2e5de3677bdcf8c86d (patch)
tree5d8fa80cc507ee8efc0c40ac8c5f0be720c7687d /llvm/lib/LTO
parent49c23908777aba4ed42427db2cd7acd141b0406e (diff)
downloadbcm5719-llvm-077cc3fcb01d2a38d2591b2e5de3677bdcf8c86d.tar.gz
bcm5719-llvm-077cc3fcb01d2a38d2591b2e5de3677bdcf8c86d.zip
[ThinLTO/WPD] Ensure devirtualized targets use promoted symbol when necessary
Summary: This fixes a hole in the handling of devirtualized targets that were local but need promoting due to devirtualization in another module. We were not correctly referencing the promoted symbol in some cases. Make sure the code that updates the name also looks at the ExportedGUIDs set by utilizing a callback that checks all conditions (the callback utilized by the internalization/promotion code). Reviewers: pcc, davidxl, hiraditya Subscribers: mehdi_amini, Prazek, inglorion, steven_wu, dexonsmith, dang, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68159 llvm-svn: 373485
Diffstat (limited to 'llvm/lib/LTO')
-rw-r--r--llvm/lib/LTO/LTO.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
index 9e16cba44fd..6c5858b942a 100644
--- a/llvm/lib/LTO/LTO.cpp
+++ b/llvm/lib/LTO/LTO.cpp
@@ -1304,11 +1304,6 @@ Error LTO::runThinLTO(AddStreamFn AddStream, NativeObjectCache Cache,
ComputeCrossModuleImport(ThinLTO.CombinedIndex, ModuleToDefinedGVSummaries,
ImportLists, ExportLists);
- // Update local devirtualized targets that were exported by cross-module
- // importing
- updateIndexWPDForExports(ThinLTO.CombinedIndex, ExportLists,
- LocalWPDTargetsMap);
-
// Figure out which symbols need to be internalized. This also needs to happen
// at -O0 because summary-based DCE is implemented using internalization, and
// we must apply DCE consistently with the full LTO module in order to avoid
@@ -1338,6 +1333,12 @@ Error LTO::runThinLTO(AddStreamFn AddStream, NativeObjectCache Cache,
ExportList->second.count(GUID)) ||
ExportedGUIDs.count(GUID);
};
+
+ // Update local devirtualized targets that were exported by cross-module
+ // importing or by other devirtualizations marked in the ExportedGUIDs set.
+ updateIndexWPDForExports(ThinLTO.CombinedIndex, isExported,
+ LocalWPDTargetsMap);
+
auto isPrevailing = [&](GlobalValue::GUID GUID,
const GlobalValueSummary *S) {
return ThinLTO.PrevailingModuleForGUID[GUID] == S->modulePath();
OpenPOWER on IntegriCloud