Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

The function returns an instance of FunctionSummary populated by
calculateCallGraphRoot regardless of whether Edges is empty or not.

The function returns an instance of FunctionSummary populated by
calculateCallGraphRoot regardless of whether Edges is empty or not.
@llvmbot
Copy link
Member

llvmbot commented Sep 8, 2024

@llvm/pr-subscribers-llvm-ir

Author: Kazu Hirata (kazutakahirata)

Changes

The function returns an instance of FunctionSummary populated by
calculateCallGraphRoot regardless of whether Edges is empty or not.


Full diff: https://github.com/llvm/llvm-project/pull/107765.diff

1 Files Affected:

  • (modified) llvm/include/llvm/IR/ModuleSummaryIndex.h (+1-8)
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 {

@kazutakahirata kazutakahirata merged commit c36c462 into llvm:main Sep 9, 2024
@kazutakahirata kazutakahirata deleted the cleanup_thinlto_calculateCallGraphRoot branch September 9, 2024 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants