summaryrefslogtreecommitdiffstats
path: root/llvm
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
commit212d5c27f6bae67d3c5d819dd4204fde6fd8efd5 (patch)
treeeb2798607f08285b3ebf46106019550a4b8cbc74 /llvm
parentd66e285b2e27bea35b5c9fd04f715c06d98f7634 (diff)
downloadbcm5719-llvm-212d5c27f6bae67d3c5d819dd4204fde6fd8efd5.tar.gz
bcm5719-llvm-212d5c27f6bae67d3c5d819dd4204fde6fd8efd5.zip
Use more caching when computing non-local dependence. This makes bzip2 not
use up the entire 32-bit address space. llvm-svn: 40596
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Analysis/MemoryDependenceAnalysis.cpp2
-rw-r--r--llvm/lib/Transforms/Scalar/GVN.cpp4
2 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
index 4bd877142a2..02b0af6f0f9 100644
--- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/llvm/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/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp
index ab6c913605e..fee0eedcc77 100644
--- a/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud