diff options
Diffstat (limited to 'lib/Transforms/Utils/LCSSA.cpp')
-rw-r--r-- | lib/Transforms/Utils/LCSSA.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/Utils/LCSSA.cpp b/lib/Transforms/Utils/LCSSA.cpp index 3f4bad5c51..220241df33 100644 --- a/lib/Transforms/Utils/LCSSA.cpp +++ b/lib/Transforms/Utils/LCSSA.cpp @@ -231,6 +231,10 @@ Value *LCSSA::GetValueForBlock(DomTreeNode *BB, Instruction *OrigInst, DomTreeNode *IDom = BB->getIDom(); + // If the block has no dominator, bail + if (!IDom) + return V = UndefValue::get(OrigInst->getType()); + // Otherwise, there are two cases: we either have to insert a PHI node or we // don't. We need to insert a PHI node if this block is not dominated by one // of the exit nodes from the loop (the loop could have multiple exits, and |