aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/LoopDependenceAnalysis.cpp
diff options
context:
space:
mode:
authorAndreas Bolka <a@bolka.at>2009-07-28 19:49:49 +0000
committerAndreas Bolka <a@bolka.at>2009-07-28 19:49:49 +0000
commit328fb3d2107e7480826fbb4e3b0a8dae9f996f08 (patch)
treeeae7c857f25d8d6b141988d040196f75440a79d4 /lib/Analysis/LoopDependenceAnalysis.cpp
parent34ce687144cbc7e2c55cac492ada44a63f0500bb (diff)
Add LDA statistics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77358 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LoopDependenceAnalysis.cpp')
-rw-r--r--lib/Analysis/LoopDependenceAnalysis.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Analysis/LoopDependenceAnalysis.cpp b/lib/Analysis/LoopDependenceAnalysis.cpp
index 97c8514012..97ac3886e2 100644
--- a/lib/Analysis/LoopDependenceAnalysis.cpp
+++ b/lib/Analysis/LoopDependenceAnalysis.cpp
@@ -18,6 +18,7 @@
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "lda"
+#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/LoopDependenceAnalysis.h"
#include "llvm/Analysis/LoopPass.h"
@@ -30,6 +31,12 @@
#include "llvm/Target/TargetData.h"
using namespace llvm;
+STATISTIC(NumAnswered, "Number of dependence queries answered");
+STATISTIC(NumAnalysed, "Number of distinct dependence pairs analysed");
+STATISTIC(NumDependent, "Number of pairs with dependent accesses");
+STATISTIC(NumIndependent, "Number of pairs with independent accesses");
+STATISTIC(NumUnknown, "Number of pairs with unknown accesses");
+
LoopPass *llvm::createLoopDependenceAnalysisPass() {
return new LoopDependenceAnalysis();
}
@@ -148,11 +155,18 @@ void LoopDependenceAnalysis::analysePair(DependencePair *P) const {
bool LoopDependenceAnalysis::depends(Value *A, Value *B) {
assert(isDependencePair(A, B) && "Values form no dependence pair!");
+ ++NumAnswered;
DependencePair *p;
if (!findOrInsertDependencePair(A, B, p)) {
// The pair is not cached, so analyse it.
+ ++NumAnalysed;
analysePair(p);
+ switch (p->Result) {
+ case Dependent: ++NumDependent; break;
+ case Independent: ++NumIndependent; break;
+ case Unknown: ++NumUnknown; break;
+ }
}
return p->Result != Independent;
}