summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
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/Transforms
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/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp b/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
index 4490a7ef62a..4055fe04999 100644
--- a/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
+++ b/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
@@ -713,7 +713,7 @@ void runWholeProgramDevirtOnIndex(
void updateIndexWPDForExports(
ModuleSummaryIndex &Summary,
- StringMap<FunctionImporter::ExportSetTy> &ExportLists,
+ function_ref<bool(StringRef, GlobalValue::GUID)> isExported,
std::map<ValueInfo, std::vector<VTableSlotSummary>> &LocalWPDTargetsMap) {
for (auto &T : LocalWPDTargetsMap) {
auto &VI = T.first;
@@ -721,9 +721,7 @@ void updateIndexWPDForExports(
assert(VI.getSummaryList().size() == 1 &&
"Devirt of local target has more than one copy");
auto &S = VI.getSummaryList()[0];
- const auto &ExportList = ExportLists.find(S->modulePath());
- if (ExportList == ExportLists.end() ||
- !ExportList->second.count(VI.getGUID()))
+ if (!isExported(S->modulePath(), VI.getGUID()))
continue;
// It's been exported by a cross module import.
OpenPOWER on IntegriCloud