[llvm] c36c462 - [LTO] Simplify calculateCallGraphRoot (NFC) (#107765)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 9 09:44:40 PDT 2024
Author: Kazu Hirata
Date: 2024-09-09T09:44:37-07:00
New Revision: c36c462cc719d47aa2408bca91a028300b2be6d4
URL: https://github.com/llvm/llvm-project/commit/c36c462cc719d47aa2408bca91a028300b2be6d4
DIFF: https://github.com/llvm/llvm-project/commit/c36c462cc719d47aa2408bca91a028300b2be6d4.diff
LOG: [LTO] Simplify calculateCallGraphRoot (NFC) (#107765)
The function returns an instance of FunctionSummary populated by
calculateCallGraphRoot regardless of whether Edges is empty or not.
Added:
Modified:
llvm/include/llvm/IR/ModuleSummaryIndex.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/IR/ModuleSummaryIndex.h b/llvm/include/llvm/IR/ModuleSummaryIndex.h
index dae208d0b132e4..288aba16702f56 100644
--- a/llvm/include/llvm/IR/ModuleSummaryIndex.h
+++ b/llvm/include/llvm/IR/ModuleSummaryIndex.h
@@ -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 {
More information about the llvm-commits
mailing list