summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2016-04-24 14:57:11 +0000
committerTeresa Johnson <tejohnson@google.com>2016-04-24 14:57:11 +0000
commit28e457bccd6d1dd6ba91d36253073372a1bb5d75 (patch)
tree5368e89d5262e31ef567218d31c72a894cde3f5c /llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
parent9f5697ef6803acededad77a51b40a3fbec905c81 (diff)
downloadbcm5719-llvm-28e457bccd6d1dd6ba91d36253073372a1bb5d75.tar.gz
bcm5719-llvm-28e457bccd6d1dd6ba91d36253073372a1bb5d75.zip
[ThinLTO] Remove GlobalValueInfo class from index
Summary: Remove the GlobalValueInfo and change the ModuleSummaryIndex to directly reference summary objects. The info structure was there to support lazy parsing of the combined index summary objects, which is no longer needed and not supported. Reviewers: joker.eph Subscribers: joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D19462 llvm-svn: 267344
Diffstat (limited to 'llvm/lib/Analysis/ModuleSummaryAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/ModuleSummaryAnalysis.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
index d0731eda73d..ed1b57124b6 100644
--- a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
+++ b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
@@ -61,8 +61,8 @@ static void findRefEdges(const User *CurUser, DenseSet<const Value *> &RefEdges,
}
}
-void ModuleSummaryIndexBuilder::computeFunctionInfo(const Function &F,
- BlockFrequencyInfo *BFI) {
+void ModuleSummaryIndexBuilder::computeFunctionSummary(
+ const Function &F, BlockFrequencyInfo *BFI) {
// Summary not currently supported for anonymous functions, they must
// be renamed.
if (!F.hasName())
@@ -100,12 +100,11 @@ void ModuleSummaryIndexBuilder::computeFunctionInfo(const Function &F,
llvm::make_unique<FunctionSummary>(Flags, NumInsts);
FuncSummary->addCallGraphEdges(CallGraphEdges);
FuncSummary->addRefEdges(RefEdges);
- std::unique_ptr<GlobalValueInfo> GVInfo =
- llvm::make_unique<GlobalValueInfo>(0, std::move(FuncSummary));
- Index->addGlobalValueInfo(F.getName(), std::move(GVInfo));
+ Index->addGlobalValueSummary(F.getName(), std::move(FuncSummary));
}
-void ModuleSummaryIndexBuilder::computeVariableInfo(const GlobalVariable &V) {
+void ModuleSummaryIndexBuilder::computeVariableSummary(
+ const GlobalVariable &V) {
DenseSet<const Value *> RefEdges;
SmallPtrSet<const User *, 8> Visited;
findRefEdges(&V, RefEdges, Visited);
@@ -113,9 +112,7 @@ void ModuleSummaryIndexBuilder::computeVariableInfo(const GlobalVariable &V) {
std::unique_ptr<GlobalVarSummary> GVarSummary =
llvm::make_unique<GlobalVarSummary>(Flags);
GVarSummary->addRefEdges(RefEdges);
- std::unique_ptr<GlobalValueInfo> GVInfo =
- llvm::make_unique<GlobalValueInfo>(0, std::move(GVarSummary));
- Index->addGlobalValueInfo(V.getName(), std::move(GVInfo));
+ Index->addGlobalValueSummary(V.getName(), std::move(GVarSummary));
}
ModuleSummaryIndexBuilder::ModuleSummaryIndexBuilder(
@@ -164,7 +161,7 @@ ModuleSummaryIndexBuilder::ModuleSummaryIndexBuilder(
BFI = BFIPtr.get();
}
- computeFunctionInfo(F, BFI);
+ computeFunctionSummary(F, BFI);
}
// Compute summaries for all variables defined in module, and save in the
@@ -172,7 +169,7 @@ ModuleSummaryIndexBuilder::ModuleSummaryIndexBuilder(
for (const GlobalVariable &G : M->globals()) {
if (G.isDeclaration())
continue;
- computeVariableInfo(G);
+ computeVariableSummary(G);
}
}
OpenPOWER on IntegriCloud