summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/ModuleSummaryIndex.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2018-02-05 17:17:51 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2018-02-05 17:17:51 +0000
commitb4edfb9af93c39f448ac649edff3be4d17263297 (patch)
treec25cddc1a2e1c106dd8d263626456c9b89dcd6c3 /llvm/lib/IR/ModuleSummaryIndex.cpp
parent2329fcd293e138924d96d4b2643dab7f3d60c3f3 (diff)
downloadbcm5719-llvm-b4edfb9af93c39f448ac649edff3be4d17263297.tar.gz
bcm5719-llvm-b4edfb9af93c39f448ac649edff3be4d17263297.zip
LTO: Include dso-local bit in ThinLTO cache key.
Differential Revision: https://reviews.llvm.org/D42713 llvm-svn: 324253
Diffstat (limited to 'llvm/lib/IR/ModuleSummaryIndex.cpp')
-rw-r--r--llvm/lib/IR/ModuleSummaryIndex.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/IR/ModuleSummaryIndex.cpp b/llvm/lib/IR/ModuleSummaryIndex.cpp
index ce4c8cc3c80..ce74c00766f 100644
--- a/llvm/lib/IR/ModuleSummaryIndex.cpp
+++ b/llvm/lib/IR/ModuleSummaryIndex.cpp
@@ -17,6 +17,15 @@
#include "llvm/Support/Path.h"
using namespace llvm;
+bool ValueInfo::isDSOLocal() const {
+ // Need to check all summaries are local in case of hash collisions.
+ return getSummaryList().size() &&
+ llvm::all_of(getSummaryList(),
+ [](const std::unique_ptr<GlobalValueSummary> &Summary) {
+ return Summary->isDSOLocal();
+ });
+}
+
// Collect for the given module the list of function it defines
// (GUID -> Summary).
void ModuleSummaryIndex::collectDefinedFunctionsForModule(
OpenPOWER on IntegriCloud