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
This commit is contained in:
Owen Anderson 2007-08-14 17:59:48 +00:00
parent 6d6403c287
commit 8e8278e7fe

View File

@ -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 &&