[PATCH] D9689: Add a stat to show how often the MaxLookupSearchDepth limit is hit

Wei Mi wmi at google.com
Wed Aug 5 16:41:14 PDT 2015


This revision was automatically updated to reflect the committed changes.
Closed by commit rL244174: Add a stat to show how often the limit to decompose GEPs in BasicAA is reached. (authored by wmi).

Changed prior to commit:
  http://reviews.llvm.org/D9689?vs=25528&id=31420#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D9689

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

Index: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
===================================================================
--- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
+++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
@@ -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 @@
 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 @@
   // Limit recursion depth to limit compile time in crazy cases.
   unsigned MaxLookup = MaxLookupSearchDepth;
   MaxLookupReached = false;
+  SearchTimes++;
 
   BaseOffs = 0;
   do {
@@ -420,6 +430,7 @@
 
   // If the chain of expressions is too deep, just return early.
   MaxLookupReached = true;
+  SearchLimitReached++;
   return V;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9689.31420.patch
Type: text/x-patch
Size: 1635 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150805/b207d87d/attachment.bin>


More information about the llvm-commits mailing list