aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index e3c45d40fb..f8373cb6e2 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<Instruction>(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<InvokeInst>(I))
for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i)
if (isa<UndefValue>(PN.getIncomingValue(i))) {
V = 0;