Use more caching when computing non-local dependence. This makes bzip2 not
authorOwen Anderson <resistor@mac.com>
Mon, 30 Jul 2007 17:29:24 +0000 (17:29 +0000)
committerOwen Anderson <resistor@mac.com>
Mon, 30 Jul 2007 17:29:24 +0000 (17:29 +0000)
use up the entire 32-bit address space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40596 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/MemoryDependenceAnalysis.cpp
lib/Transforms/Scalar/GVN.cpp

index 4bd877142a2ba99213b59cd259ec0656cae838a8..02b0af6f0f93d908a673fd3dd9b369b78b8d8b3e 100644 (file)
@@ -129,6 +129,8 @@ bool MemoryDependenceAnalysis::nonLocalHelper(Instruction* query,
 
   if (!inserted && !predOnStack)
     resp.insert(std::make_pair(block, None));
+  else if (inserted && predOnStack)
+    resp.insert(std::make_pair(block, NonLocal));
   
   return inserted;
 }
index ab6c913605e02a2aad178d07942e02cf43fcdc86..fee0eedcc770770bba0c7f16096954eac676f53d 100644 (file)
@@ -752,7 +752,9 @@ bool GVN::processNonLocalLoad(LoadInst* L, SmallVector<Instruction*, 4>& toErase
        I != E; ++I)
     if (I->second == MemoryDependenceAnalysis::None) {
       return false;
-    } else if (StoreInst* S = dyn_cast<StoreInst>(I->second)) {
+    } else if (I->second == MemoryDependenceAnalysis::NonLocal) {
+      continue;
+    }else if (StoreInst* S = dyn_cast<StoreInst>(I->second)) {
       if (S->getPointerOperand() == L->getPointerOperand())
         repl.insert(std::make_pair(I->first, S->getOperand(0)));
       else