[cfe-commits] r162687 - in /cfe/trunk: lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp utils/analyzer/SumTimerInfo.py

Anna Zaks ganna at apple.com
Mon Aug 27 11:38:32 PDT 2012


Author: zaks
Date: Mon Aug 27 13:38:32 2012
New Revision: 162687

URL: http://llvm.org/viewvc/llvm-project?rev=162687&view=rev
Log:
[analyzer] More internal stats collection.

Modified:
    cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
    cfe/trunk/utils/analyzer/SumTimerInfo.py

Modified: cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp?rev=162687&r1=162686&r2=162687&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp Mon Aug 27 13:38:32 2012
@@ -28,6 +28,9 @@
 STATISTIC(NumOfDynamicDispatchPathSplits,
   "The # of times we split the path due to imprecise dynamic dispatch info");
 
+STATISTIC(NumInlinedCalls,
+  "The # of times we inlined a call");
+
 void ExprEngine::processCallEnter(CallEnter CE, ExplodedNode *Pred) {
   // Get the entry block in the CFG of the callee.
   const StackFrameContext *calleeCtx = CE.getCalleeContext();
@@ -442,6 +445,8 @@
   // added onto the work list so remove it from the node builder.
   Bldr.takeNodes(Pred);
 
+  NumInlinedCalls++;
+
   return true;
 }
 

Modified: cfe/trunk/utils/analyzer/SumTimerInfo.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/analyzer/SumTimerInfo.py?rev=162687&r1=162686&r2=162687&view=diff
==============================================================================
--- cfe/trunk/utils/analyzer/SumTimerInfo.py (original)
+++ cfe/trunk/utils/analyzer/SumTimerInfo.py Mon Aug 27 13:38:32 2012
@@ -28,6 +28,8 @@
     ReachableBlocks = 0
     ReachedMaxSteps = 0
     NumSteps = 0
+    NumInlinedCallSites = 0
+    NumBifurcatedCallSites = 0
     MaxCFGSize = 0
     Mode = 1
     for line in f:
@@ -39,25 +41,31 @@
           Count = Count + 1
           if (float(s[6]) > MaxTime) :
             MaxTime = float(s[6])
-        if ((("warning generated." in line) or ("warnings generated." in line)) and Mode == 1) :
+        if ((("warning generated." in line) or ("warnings generated" in line)) and Mode == 1) :
           s = line.split()
           Warnings = Warnings + int(s[0])
-        if (("The # of functions analysed (as top level)." in line) and (Mode == 1)) :
+        if (("The # of functions analysed (as top level)" in line) and (Mode == 1)) :
           s = line.split()
           FunctionsAnalyzed = FunctionsAnalyzed + int(s[0])
         if (("The % of reachable basic blocks" in line) and (Mode == 1)) :
           s = line.split()
           ReachableBlocks = ReachableBlocks + int(s[0])
-        if (("The # of times we reached the max number of steps." in line) and (Mode == 1)) :
+        if (("The # of times we reached the max number of steps" in line) and (Mode == 1)) :
           s = line.split()
           ReachedMaxSteps = ReachedMaxSteps + int(s[0])
         if (("The maximum number of basic blocks in a function" in line) and (Mode == 1)) :
           s = line.split()
           if (MaxCFGSize < int(s[0])) :
             MaxCFGSize = int(s[0])
-        if (("The # of steps executed." in line) and (Mode == 1)) :
+        if (("The # of steps executed" in line) and (Mode == 1)) :
           s = line.split()
           NumSteps = NumSteps + int(s[0])
+        if (("The # of times we inlined a call" in line) and (Mode == 1)) :
+          s = line.split()
+          NumInlinedCallSites = NumInlinedCallSites + int(s[0])
+        if (("The # of times we split the path due to imprecise dynamic dispatch info" in line) and (Mode == 1)) :
+          s = line.split()
+          NumBifurcatedCallSites = NumBifurcatedCallSites + int(s[0])
         if ((")  Total" in line) and (Mode == 1)) :
           s = line.split()
           TotalTime = TotalTime + float(s[6])
@@ -69,6 +77,7 @@
     print "Reachable Blocks %d" % (ReachableBlocks)
     print "Reached Max Steps %d" % (ReachedMaxSteps)
     print "Number of Steps %d" % (NumSteps)
+    print "Number of Inlined calls %d (bifurcated %d)" % (NumInlinedCallSites, NumBifurcatedCallSites)
     print "MaxTime %f" % (MaxTime)
     print "TotalTime %f" % (TotalTime)
     print "Max CFG Size %d" % (MaxCFGSize)





More information about the cfe-commits mailing list