Remove an un-needed dependence query. This improves compile time marginally on 401...
authorOwen Anderson <resistor@mac.com>
Sun, 9 Sep 2007 21:43:49 +0000 (21:43 +0000)
committerOwen Anderson <resistor@mac.com>
Sun, 9 Sep 2007 21:43:49 +0000 (21:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41792 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/MemoryDependenceAnalysis.cpp

index 11a80091085ea0f840d217a2b2b44731e02d0b03..3072a5c5737729243bd5a2fc73a6a46b1e2886cc 100644 (file)
 #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