Author: resistor Date: Thu Nov 29 12:02:22 2007 New Revision: 44437 URL: http://llvm.org/viewvc/llvm-project?rev=44437&view=rev Log: Fix a miscompilation in spiff on PPC.
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=44437&r1=44436&r2=44437&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Thu Nov 29 12:02:22 2007 @@ -1054,7 +1054,8 @@ 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); _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits