[llvm] [CodeMetrics] Remove `NumCalls` (NFC) (PR #219120)

via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 22:49:50 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-analysis

Author: Justin Fargnoli (justinfargnoli)

<details>
<summary>Changes</summary>

This is dead code. 

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


2 Files Affected:

- (modified) llvm/include/llvm/Analysis/CodeMetrics.h (-3) 
- (modified) llvm/lib/Analysis/CodeMetrics.cpp (-5) 


``````````diff
diff --git a/llvm/include/llvm/Analysis/CodeMetrics.h b/llvm/include/llvm/Analysis/CodeMetrics.h
index 4f33e09aae199..f3e2cf5d9481d 100644
--- a/llvm/include/llvm/Analysis/CodeMetrics.h
+++ b/llvm/include/llvm/Analysis/CodeMetrics.h
@@ -57,9 +57,6 @@ struct CodeMetrics {
   /// Keeps track of basic block code size estimates. Indexed by block number.
   SmallVector<InstructionCost, 0> NumBBInsts;
 
-  /// Keep track of the number of calls to 'big' functions.
-  unsigned NumCalls = 0;
-
   /// The number of calls to internal functions with a single caller.
   ///
   /// These are likely targets for future inlining, likely exposed by
diff --git a/llvm/lib/Analysis/CodeMetrics.cpp b/llvm/lib/Analysis/CodeMetrics.cpp
index 91ac089dfdd4e..dcb1fe0a6cc89 100644
--- a/llvm/lib/Analysis/CodeMetrics.cpp
+++ b/llvm/lib/Analysis/CodeMetrics.cpp
@@ -158,12 +158,7 @@ void CodeMetrics::analyzeBasicBlock(
         if (F == BB->getParent())
           isRecursive = true;
 
-        if (IsLoweredToCall)
-          ++NumCalls;
       } else if (!Call->isInlineAsm()) {
-        // We don't want inline asm to count as a call - that would prevent loop
-        // unrolling. The argument setup cost is still real, though.
-        ++NumCalls;
         // When preparing for LTO, consider indirect calls as potential inline
         // candidates since they may be resolved during post-link LTO
         if (PrepareForLTO && !Call->isNoInline())

``````````

</details>


https://github.com/llvm/llvm-project/pull/219120


More information about the llvm-commits mailing list