From 28e457bccd6d1dd6ba91d36253073372a1bb5d75 Mon Sep 17 00:00:00 2001 From: Teresa Johnson Date: Sun, 24 Apr 2016 14:57:11 +0000 Subject: [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 --- llvm/lib/Analysis/ModuleSummaryAnalysis.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'llvm/lib/Analysis/ModuleSummaryAnalysis.cpp') 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 &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(Flags, NumInsts); FuncSummary->addCallGraphEdges(CallGraphEdges); FuncSummary->addRefEdges(RefEdges); - std::unique_ptr GVInfo = - llvm::make_unique(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 RefEdges; SmallPtrSet Visited; findRefEdges(&V, RefEdges, Visited); @@ -113,9 +112,7 @@ void ModuleSummaryIndexBuilder::computeVariableInfo(const GlobalVariable &V) { std::unique_ptr GVarSummary = llvm::make_unique(Flags); GVarSummary->addRefEdges(RefEdges); - std::unique_ptr GVInfo = - llvm::make_unique(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); } } -- cgit v1.2.3