From 1fb136464deda4feb6724c9874d17eb4867633c0 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Thu, 29 Nov 2007 18:02:22 +0000 Subject: [PATCH] Fix a miscompilation in spiff on PPC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44437 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/GVN.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index e3ce9eb62a4..7799befb3c2 100644 --- a/lib/Transforms/Scalar/GVN.cpp +++ b/lib/Transforms/Scalar/GVN.cpp @@ -1054,7 +1054,8 @@ bool GVN::processInstruction(Instruction* I, if (CI->getCalledFunction() && !AA.doesNotAccessMemory(CI->getCalledFunction())) { MemoryDependenceAnalysis& MD = getAnalysis(); - if (MD.getDependency(CI) != MD.getDependency(cast(repl))) { + if (cast(repl)->getParent() != CI->getParent() || + MD.getDependency(CI) != MD.getDependency(cast(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);