From 2960ed4b85d49fbdb3270605a1bfdbfbdcb97d62 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Tue, 17 Jun 2008 22:27:06 +0000 Subject: [PATCH] We don't want to find dependencies within the same block in this case. It leads to incorrect results because we're detecting something at or after the call we're querying on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52433 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/GVN.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index 563f6e61b34..7ea3ed89c37 100644 --- a/lib/Transforms/Scalar/GVN.cpp +++ b/lib/Transforms/Scalar/GVN.cpp @@ -492,7 +492,7 @@ uint32_t ValueTable::lookup_or_add(Value* V) { return nextValueNumber++; } else if (I->second != MemoryDependenceAnalysis::NonLocal) { - if (DT->dominates(I->first, C->getParent())) { + if (DT->properlyDominates(I->first, C->getParent())) { if (CallInst* CD = dyn_cast(I->second)) cdep = CD; else {