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

via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 04:23:40 PDT 2026


Author: Justin Fargnoli
Date: 2026-08-27T19:23:35+08:00
New Revision: ec75980bc3d009b20a66438f2d9c73b9bc65b2b1

URL: https://github.com/llvm/llvm-project/commit/ec75980bc3d009b20a66438f2d9c73b9bc65b2b1
DIFF: https://github.com/llvm/llvm-project/commit/ec75980bc3d009b20a66438f2d9c73b9bc65b2b1.diff

LOG: [CodeMetrics] Remove `NumCalls` (NFC) (#219120)

This is dead code.

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/CodeMetrics.h
    llvm/lib/Analysis/CodeMetrics.cpp

Removed: 
    


################################################################################
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())


        


More information about the llvm-commits mailing list