[llvm] beea06c - [NFC][Inliner] Debugging support to print funtion size after each inlining.

Hongtao Yu via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 14 22:12:01 PDT 2021


Author: Hongtao Yu
Date: 2021-03-14T22:11:53-07:00
New Revision: beea06c10642e99051a472a534ac6ede02264e41

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

LOG: [NFC][Inliner] Debugging support to print funtion size after each inlining.

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D98439

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/Inliner.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp
index e91b6c9b1d26..caba83b15111 100644
--- a/llvm/lib/Transforms/IPO/Inliner.cpp
+++ b/llvm/lib/Transforms/IPO/Inliner.cpp
@@ -776,7 +776,9 @@ PreservedAnalyses InlinerPass::run(LazyCallGraph::SCC &InitialC,
     if (CG.lookupSCC(N) != C)
       continue;
 
-    LLVM_DEBUG(dbgs() << "Inlining calls in: " << F.getName() << "\n");
+    LLVM_DEBUG(dbgs() << "Inlining calls in: " << F.getName() << "\n"
+                      << "    Function size: " << F.getInstructionCount()
+                      << "\n");
 
     auto GetAssumptionCache = [&](Function &F) -> AssumptionCache & {
       return FAM.getResult<AssumptionAnalysis>(F);
@@ -837,6 +839,9 @@ PreservedAnalyses InlinerPass::run(LazyCallGraph::SCC &InitialC,
       InlinedCallees.insert(&Callee);
       ++NumInlined;
 
+      LLVM_DEBUG(dbgs() << "    Size after inlining: "
+                        << F.getInstructionCount() << "\n");
+
       // Add any new callsites to defined functions to the worklist.
       if (!IFI.InlinedCallSites.empty()) {
         int NewHistoryID = InlineHistory.size();


        


More information about the llvm-commits mailing list