[llvm] r244174 - Add a stat to show how often the limit to decompose GEPs in BasicAA is reached.

Chad Rosier via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 6 05:42:27 PDT 2015


Can we use pre-increment on STATISTICs? If so, we should prefer that over post-increments.

-----Original Message-----
From: llvm-commits [mailto:llvm-commits-bounces at lists.llvm.org] On Behalf Of Wei Mi
Sent: Wednesday, August 05, 2015 7:41 PM
To: llvm-commits at lists.llvm.org
Subject: [llvm] r244174 - Add a stat to show how often the limit to decompose GEPs in BasicAA is reached.

Author: wmi
Date: Wed Aug  5 18:40:30 2015
New Revision: 244174

URL: http://llvm.org/viewvc/llvm-project?rev=244174&view=rev
Log:
Add a stat to show how often the limit to decompose GEPs in BasicAA is reached.

Differential Revision: http://reviews.llvm.org/D9689


Modified:
    llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp

Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=244174&r1=244173&r2=244174&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Wed Aug  5 18:40:30 
+++ 2015
@@ -16,6 +16,7 @@
 #include "llvm/Analysis/Passes.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/Statistic.h"
 #include "llvm/Analysis/AliasAnalysis.h"
 #include "llvm/Analysis/AssumptionCache.h"
 #include "llvm/Analysis/CFG.h"
@@ -46,6 +47,14 @@ using namespace llvm;  static cl::opt<bool> EnableRecPhiAnalysis("basicaa-recphi",
                                           cl::Hidden, cl::init(false));
 
+/// SearchLimitReached / SearchTimes shows how often the limit of /// 
+to decompose GEPs is reached. It will affect the precision /// of basic 
+alias analysis.
+#define DEBUG_TYPE "basicaa"
+STATISTIC(SearchLimitReached, "Number of times the limit to "
+                              "decompose GEPs is reached"); 
+STATISTIC(SearchTimes, "Number of times a GEP is decomposed");
+
 /// Cutoff after which to stop analysing a set of phi nodes potentially involved  /// in a cycle. Because we are analysing 'through' phi nodes we need to be  /// careful with value equivalence. We use reachability to make sure a value @@ -301,6 +310,7 @@ DecomposeGEPExpression(const Value *V, i
   // Limit recursion depth to limit compile time in crazy cases.
   unsigned MaxLookup = MaxLookupSearchDepth;
   MaxLookupReached = false;
+  SearchTimes++;
 
   BaseOffs = 0;
   do {
@@ -420,6 +430,7 @@ DecomposeGEPExpression(const Value *V, i
 
   // If the chain of expressions is too deep, just return early.
   MaxLookupReached = true;
+  SearchLimitReached++;
   return V;
 }
 


_______________________________________________
llvm-commits mailing list
llvm-commits at lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list