aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2007-07-30 17:29:24 +0000
committerOwen Anderson <resistor@mac.com>2007-07-30 17:29:24 +0000
commit45c8388e2a94502ded17dc493fe3fb10b04ce439 (patch)
tree98ebecfe5db2b291532428176c7dcc5102e0bac2
parent4f9ba7c40c41cae3d9730c5416a2750dea4f0ff4 (diff)
Use more caching when computing non-local dependence. This makes bzip2 not
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
-rw-r--r--lib/Analysis/MemoryDependenceAnalysis.cpp2
-rw-r--r--lib/Transforms/Scalar/GVN.cpp4
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp
index 4bd877142a..02b0af6f0f 100644
--- a/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -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;
}
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp
index ab6c913605..fee0eedcc7 100644
--- a/lib/Transforms/Scalar/GVN.cpp
+++ b/lib/Transforms/Scalar/GVN.cpp
@@ -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