diff options
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 784e80429d..e3c45d40fb 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -3386,12 +3386,12 @@ Instruction *InstCombiner::visitPHINode(PHINode &PN) { if (Instruction *I = dyn_cast<Instruction>(V)) { // We know that the instruction dominates the PHI if there are no undef // values coming in. - for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) - if (isa<UndefValue>(PN.getIncomingValue(i))) { - std::cerr << "HAD TO DISABLE PHI ELIM IN IC!\n"; - V = 0; - break; - } + if (I->getParent() != &I->getParent()->getParent()->front()) + for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) + if (isa<UndefValue>(PN.getIncomingValue(i))) { + V = 0; + break; + } } if (V) |