Skip to content

Commit

Permalink
[LTO] Simplify calculateCallGraphRoot (NFC) (llvm#107765)
Browse files Browse the repository at this point in the history
The function returns an instance of FunctionSummary populated by
calculateCallGraphRoot regardless of whether Edges is empty or not.
  • Loading branch information
kazutakahirata authored Sep 9, 2024
1 parent 7d37172 commit c36c462
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions llvm/include/llvm/IR/ModuleSummaryIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -1544,14 +1544,7 @@ class ModuleSummaryIndex {
continue; // skip over non-root nodes
Edges.push_back(std::make_pair(P.first, CalleeInfo{}));
}
if (Edges.empty()) {
// Failed to find root - return an empty node
return FunctionSummary::makeDummyFunctionSummary(
SmallVector<FunctionSummary::EdgeTy, 0>());
}
auto CallGraphRoot =
FunctionSummary::makeDummyFunctionSummary(std::move(Edges));
return CallGraphRoot;
return FunctionSummary::makeDummyFunctionSummary(std::move(Edges));
}

bool withGlobalValueDeadStripping() const {
Expand Down

0 comments on commit c36c462

Please sign in to comment.