Remove an un-needed dependence query. This improves compile time marginally on 401.bzip2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41792 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp
index 11a8009..3072a5c 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 @@
DenseMap<BasicBlock*, Value*>& resp) {
if (depGraphNonLocal.count(query)) {
resp = depGraphNonLocal[query];
+ NumCacheNonlocal++;
return;
- }
+ } else
+ NumUncacheNonlocal++;
- // 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;
- }
-
- // 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