diff options
author | Owen Anderson <resistor@mac.com> | 2007-08-14 17:59:48 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2007-08-14 17:59:48 +0000 |
commit | 8e8278e7fe66e5cf3f82f7f9b0486699f5ba3cc9 (patch) | |
tree | eb48aa2e1c034a54ee6c34da059bd5c38410e0f5 | |
parent | 6d6403c2876ac87b8e51c166e0da8338bfe011f5 (diff) | |
download | external_llvm-8e8278e7fe66e5cf3f82f7f9b0486699f5ba3cc9.zip external_llvm-8e8278e7fe66e5cf3f82f7f9b0486699f5ba3cc9.tar.gz external_llvm-8e8278e7fe66e5cf3f82f7f9b0486699f5ba3cc9.tar.bz2 |
Fix a case where GVN was failing to return true when it had, in fact, modified
the function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41077 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/GVN.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index edd11e8..1e9b177 100644 --- a/lib/Transforms/Scalar/GVN.cpp +++ b/lib/Transforms/Scalar/GVN.cpp @@ -856,10 +856,19 @@ bool GVN::processLoad(LoadInst* L, // ... to a pointer that has been loaded from before... MemoryDependenceAnalysis& MD = getAnalysis<MemoryDependenceAnalysis>(); + bool removedNonLocal = false; Instruction* dep = MD.getDependency(L); if (dep == MemoryDependenceAnalysis::NonLocal && - L->getParent() != &L->getParent()->getParent()->getEntryBlock()) - processNonLocalLoad(L, toErase); + L->getParent() != &L->getParent()->getParent()->getEntryBlock()) { + removedNonLocal = processNonLocalLoad(L, toErase); + + if (!removedNonLocal) + last = L; + + return removedNonLocal; + } + + bool deletedLoad = false; while (dep != MemoryDependenceAnalysis::None && |