aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-10-18 01:48:31 +0000
committerChris Lattner <sabre@nondot.org>2004-10-18 01:48:31 +0000
commit77bcee74da8f868c4fc83fda57f35fb72052079f (patch)
tree1b16183ea732d5610ce341fdd0acf2b0bea54bfa
parent28e792c2323a878e6a4661f043f10affc804cca2 (diff)
downloadexternal_llvm-77bcee74da8f868c4fc83fda57f35fb72052079f.zip
external_llvm-77bcee74da8f868c4fc83fda57f35fb72052079f.tar.gz
external_llvm-77bcee74da8f868c4fc83fda57f35fb72052079f.tar.bz2
My friend the invoke instruction does not dominate all basic blocks if it
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
-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 e3c45d4..f8373cb 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;