aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2007-11-29 18:02:22 +0000
committerOwen Anderson <resistor@mac.com>2007-11-29 18:02:22 +0000
commit1fb136464deda4feb6724c9874d17eb4867633c0 (patch)
treea05e6955abc891451c94b99ff3fe431bcef15693 /lib/Transforms
parent1953d0cb7d6d27da3ad067468a7ad6dd7c4fa46e (diff)
downloadexternal_llvm-1fb136464deda4feb6724c9874d17eb4867633c0.zip
external_llvm-1fb136464deda4feb6724c9874d17eb4867633c0.tar.gz
external_llvm-1fb136464deda4feb6724c9874d17eb4867633c0.tar.bz2
Fix a miscompilation in spiff on PPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44437 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/GVN.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp
index e3ce9eb..7799bef 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<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);