diff options
author | Chris Lattner <sabre@nondot.org> | 2006-10-31 17:52:18 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-10-31 17:52:18 +0000 |
commit | 1753faee81500559761646cd0b04bb73535edb8e (patch) | |
tree | 70ec54a1704a7e7ab3fa5258669352b65027c046 | |
parent | c176fa3d378f7d5570a5359c8a54b2802b7a3f20 (diff) | |
download | external_llvm-1753faee81500559761646cd0b04bb73535edb8e.zip external_llvm-1753faee81500559761646cd0b04bb73535edb8e.tar.gz external_llvm-1753faee81500559761646cd0b04bb73535edb8e.tar.bz2 |
Fix PR977 and Transforms/LCSSA/2006-10-31-UnreachableBlock.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31315 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Utils/LCSSA.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Transforms/Utils/LCSSA.cpp b/lib/Transforms/Utils/LCSSA.cpp index 6f93ac6..b369a73 100644 --- a/lib/Transforms/Utils/LCSSA.cpp +++ b/lib/Transforms/Utils/LCSSA.cpp @@ -184,7 +184,14 @@ void LCSSA::ProcessInstruction(Instruction *Instr, // Otherwise, patch up uses of the value with the appropriate LCSSA Phi, // inserting PHI nodes into join points where needed. - Value *Val = GetValueForBlock(DT->getNode(UserBB), Instr, Phis); + DominatorTree::Node *UserBBNode = DT->getNode(UserBB); + + // If the block has no dominator info, it is unreachable. + Value *Val; + if (UserBBNode) + Val = GetValueForBlock(UserBBNode, Instr, Phis); + else + Val = UndefValue::get(Instr->getType()); // Preincrement the iterator to avoid invalidating it when we change the // value. |