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 {