Skip to content

Commit c36c462

Browse files
[LTO] Simplify calculateCallGraphRoot (NFC) (llvm#107765)
The function returns an instance of FunctionSummary populated by calculateCallGraphRoot regardless of whether Edges is empty or not.
1 parent 7d37172 commit c36c462

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

llvm/include/llvm/IR/ModuleSummaryIndex.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,14 +1544,7 @@ class ModuleSummaryIndex {
15441544
continue; // skip over non-root nodes
15451545
Edges.push_back(std::make_pair(P.first, CalleeInfo{}));
15461546
}
1547-
if (Edges.empty()) {
1548-
// Failed to find root - return an empty node
1549-
return FunctionSummary::makeDummyFunctionSummary(
1550-
SmallVector<FunctionSummary::EdgeTy, 0>());
1551-
}
1552-
auto CallGraphRoot =
1553-
FunctionSummary::makeDummyFunctionSummary(std::move(Edges));
1554-
return CallGraphRoot;
1547+
return FunctionSummary::makeDummyFunctionSummary(std::move(Edges));
15551548
}
15561549

15571550
bool withGlobalValueDeadStripping() const {

0 commit comments

Comments
 (0)