From b4edfb9af93c39f448ac649edff3be4d17263297 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Mon, 5 Feb 2018 17:17:51 +0000 Subject: LTO: Include dso-local bit in ThinLTO cache key. Differential Revision: https://reviews.llvm.org/D42713 llvm-svn: 324253 --- llvm/lib/IR/ModuleSummaryIndex.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'llvm/lib/IR/ModuleSummaryIndex.cpp') 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 &Summary) { + return Summary->isDSOLocal(); + }); +} + // Collect for the given module the list of function it defines // (GUID -> Summary). void ModuleSummaryIndex::collectDefinedFunctionsForModule( -- cgit v1.2.3