summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitffa55112e0c5e6fe5beb2fc3586b547026eaf0a1 (patch)
tree3f4bd65d2dc4e1cad23415345ded83010a71ca85 /llvm/lib/Transforms
parent8494ee175ca41848d73ade61d0064c600dddf610 (diff)
downloadbcm5719-llvm-ffa55112e0c5e6fe5beb2fc3586b547026eaf0a1.tar.gz
bcm5719-llvm-ffa55112e0c5e6fe5beb2fc3586b547026eaf0a1.zip
Fix a miscompilation in spiff on PPC.
llvm-svn: 44437
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/GVN.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp
index e3ce9eb62a4..7799befb3c2 100644
--- a/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud