aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/MemoryDependenceAnalysis.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/MemoryDependenceAnalysis.cpp')
-rw-r--r--lib/Analysis/MemoryDependenceAnalysis.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp
index 11a8009108..3072a5c573 100644
--- a/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -21,9 +21,15 @@
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Support/CFG.h"
#include "llvm/Target/TargetData.h"
+#include "llvm/ADT/Statistic.h"
+
+#define DEBUG_TYPE "memdep"
using namespace llvm;
+STATISTIC(NumCacheNonlocal, "Number of cached non-local responses");
+STATISTIC(NumUncacheNonlocal, "Number of uncached non-local responses");
+
char MemoryDependenceAnalysis::ID = 0;
Instruction* const MemoryDependenceAnalysis::NonLocal = (Instruction*)-3;
@@ -205,17 +211,12 @@ void MemoryDependenceAnalysis::getNonLocalDependency(Instruction* query,
DenseMap<BasicBlock*, Value*>& resp) {
if (depGraphNonLocal.count(query)) {
resp = depGraphNonLocal[query];
+ NumCacheNonlocal++;
return;
- }
-
- // First check that we don't actually have a local dependency.
- Instruction* localDep = getDependency(query);
- if (localDep != NonLocal) {
- resp.insert(std::make_pair(query->getParent(),localDep));
- return;
- }
+ } else
+ NumUncacheNonlocal++;
- // If not, go ahead and search for non-local ones.
+ // If not, go ahead and search for non-local deps.
nonLocalHelper(query, query->getParent(), resp);
// Update the non-local dependency cache