diff options
author | Teresa Johnson <tejohnson@google.com> | 2017-07-17 19:25:38 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2017-07-17 19:25:38 +0000 |
commit | f9dc3deaa6ff46aee8adf5f7f38a94daf904c21d (patch) | |
tree | 76cfa6403a7572e3f88a0403540538416e584e3d /llvm/lib/Transforms/IPO/FunctionImport.cpp | |
parent | 7873d822f79b8cde7642cf94b8c7d68223f5404b (diff) | |
download | bcm5719-llvm-f9dc3deaa6ff46aee8adf5f7f38a94daf904c21d.tar.gz bcm5719-llvm-f9dc3deaa6ff46aee8adf5f7f38a94daf904c21d.zip |
Revert "Restore with fix "[ThinLTO] Ensure we always select the same function copy to import""
This reverts commit r308114 (and follow on fixes to test).
There is a linking failure in a ThinLTO bot:
http://green.lab.llvm.org/green/job/clang-stage2-configure-Rthinlto_build/3663/
(and undefined reference). It seems like it must be a second order
effect of the heuristic change I made, and may take some time to try
to reproduce locally and track down. Therefore, reverting for now.
llvm-svn: 308206
Diffstat (limited to 'llvm/lib/Transforms/IPO/FunctionImport.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/FunctionImport.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp index f3460c49422..233a36d2bc5 100644 --- a/llvm/lib/Transforms/IPO/FunctionImport.cpp +++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp @@ -125,7 +125,6 @@ static const GlobalValueSummary * selectCallee(const ModuleSummaryIndex &Index, ArrayRef<std::unique_ptr<GlobalValueSummary>> CalleeSummaryList, unsigned Threshold, StringRef CallerModulePath) { - // Find the first eligible callee (e.g. legality checks). auto It = llvm::find_if( CalleeSummaryList, [&](const std::unique_ptr<GlobalValueSummary> &SummaryPtr) { @@ -161,6 +160,9 @@ selectCallee(const ModuleSummaryIndex &Index, Summary->modulePath() != CallerModulePath) return false; + if (Summary->instCount() > Threshold) + return false; + if (Summary->notEligibleToImport()) return false; @@ -169,19 +171,7 @@ selectCallee(const ModuleSummaryIndex &Index, if (It == CalleeSummaryList.end()) return nullptr; - // Now check if the first eligible callee is under the instruction - // threshold. Checking this on the first eligible callee ensures that - // we don't end up selecting different callees to import when we invoke - // this routine with different thresholds (when there are multiple copies, - // i.e. with weak or linkonce linkage). - auto *Summary = dyn_cast<FunctionSummary>(It->get()); - if (auto *AS = dyn_cast<AliasSummary>(It->get())) - Summary = cast<FunctionSummary>(&AS->getAliasee()); - assert(Summary && "Expected FunctionSummary, or alias to one"); - if (Summary->instCount() > Threshold) - return nullptr; - - return Summary; + return cast<GlobalValueSummary>(It->get()); } using EdgeInfo = std::tuple<const FunctionSummary *, unsigned /* Threshold */, |