From 077cc3fcb01d2a38d2591b2e5de3677bdcf8c86d Mon Sep 17 00:00:00 2001 From: Teresa Johnson Date: Wed, 2 Oct 2019 16:36:59 +0000 Subject: [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 --- llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Transforms') 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 &ExportLists, + function_ref isExported, std::map> &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. -- cgit v1.2.3