#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;
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