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 && _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits