summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/BasicAliasAnalysis.cpp
diff options
context:
space:
mode:
authorWei Mi <wmi@google.com>2015-08-05 23:40:30 +0000
committerWei Mi <wmi@google.com>2015-08-05 23:40:30 +0000
commitd67daae4f1f5d5aa65d5494c702ae365758d3612 (patch)
tree333055b40340665943572b29d61daa591c83f1dc /llvm/lib/Analysis/BasicAliasAnalysis.cpp
parent1c2f64d1a6b9e9043515c087fe4bc74ad0a0944c (diff)
downloadbcm5719-llvm-d67daae4f1f5d5aa65d5494c702ae365758d3612.tar.gz
bcm5719-llvm-d67daae4f1f5d5aa65d5494c702ae365758d3612.zip
Add a stat to show how often the limit to decompose GEPs in BasicAA is reached.
Differential Revision: http://reviews.llvm.org/D9689 llvm-svn: 244174
Diffstat (limited to 'llvm/lib/Analysis/BasicAliasAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/BasicAliasAnalysis.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
index 511ea4bbfab..2e639f04d5a 100644
--- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/llvm/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 @@ 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, int64_t &BaseOffs,
// 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, int64_t &BaseOffs,
// If the chain of expressions is too deep, just return early.
MaxLookupReached = true;
+ SearchLimitReached++;
return V;
}
OpenPOWER on IntegriCloud