From: Dan Gohman Date: Thu, 20 May 2010 22:46:54 +0000 (+0000) Subject: DominatorTree.getNode can return null for unreachable blocks. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=0fe46d9b480ab4851e1fc8bc589d1ed9c8b2a70e;p=oota-llvm.git DominatorTree.getNode can return null for unreachable blocks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104290 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 1f6ae6a7d94..86ea3eb6cdb 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -3127,7 +3127,7 @@ LSRInstance::HoistInsertPosition(BasicBlock::iterator IP, BasicBlock *IDom; for (DomTreeNode *Rung = DT.getNode(IP->getParent()); ; ) { - assert(Rung && "Block has no DomTreeNode!"); + if (!Rung) return IP; Rung = Rung->getIDom(); if (!Rung) return IP; IDom = Rung->getBlock();