diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index e3c45d40fb2..f8373cb6e26 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -3386,7 +3386,8 @@ Instruction *InstCombiner::visitPHINode(PHINode &PN) { if (Instruction *I = dyn_cast(V)) { // We know that the instruction dominates the PHI if there are no undef // values coming in. - if (I->getParent() != &I->getParent()->getParent()->front()) + if (I->getParent() != &I->getParent()->getParent()->front() || + isa(I)) for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) if (isa(PN.getIncomingValue(i))) { V = 0;