[llvm-commits] [llvm] r41077 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp
Owen Anderson
resistor at mac.com
Tue Aug 14 10:59:48 PDT 2007
Author: resistor
Date: Tue Aug 14 12:59:48 2007
New Revision: 41077
URL: http://llvm.org/viewvc/llvm-project?rev=41077&view=rev
Log:
Fix a case where GVN was failing to return true when it had, in fact, modified
the function.
Modified:
llvm/trunk/lib/Transforms/Scalar/GVN.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=41077&r1=41076&r2=41077&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Tue Aug 14 12:59:48 2007
@@ -856,10 +856,19 @@
// ... 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 &&
More information about the llvm-commits
mailing list