My friend the invoke instruction does not dominate all basic blocks if it
authorChris Lattner <sabre@nondot.org>
Mon, 18 Oct 2004 01:48:31 +0000 (01:48 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 18 Oct 2004 01:48:31 +0000 (01:48 +0000)
occurs in the entry node of a function

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17109 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InstructionCombining.cpp

index e3c45d40fb25b217b03e20a4e673df9e7d1b27cc..f8373cb6e269c91b76015e73267c04f466c1f143 100644 (file)
@@ -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;