[llvm-commits] [llvm] r41792 - /llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp

Owen Anderson resistor at mac.com
Sun Sep 9 14:43:51 PDT 2007


Author: resistor
Date: Sun Sep  9 16:43:49 2007
New Revision: 41792

URL: http://llvm.org/viewvc/llvm-project?rev=41792&view=rev
Log:
Remove an un-needed dependence query.  This improves compile time marginally on 401.bzip2.

Modified:
    llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp

Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=41792&r1=41791&r2=41792&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Sun Sep  9 16:43:49 2007
@@ -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;
-  }
-  
-  // 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





More information about the llvm-commits mailing list