Fix a miscompilation in spiff on PPC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44437 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson 2007-11-29 18:02:22 +00:00
parent 1953d0cb7d
commit 1fb136464d

View File

@ -1054,7 +1054,8 @@ bool GVN::processInstruction(Instruction* I,
if (CI->getCalledFunction() &&
!AA.doesNotAccessMemory(CI->getCalledFunction())) {
MemoryDependenceAnalysis& MD = getAnalysis<MemoryDependenceAnalysis>();
if (MD.getDependency(CI) != MD.getDependency(cast<CallInst>(repl))) {
if (cast<Instruction>(repl)->getParent() != CI->getParent() ||
MD.getDependency(CI) != MD.getDependency(cast<CallInst>(repl))) {
// There must be an intervening may-alias store, so nothing from
// this point on will be able to be replaced with the preceding call
currAvail.erase(repl);