DominatorTree.getNode can return null for unreachable blocks.
authorDan Gohman <gohman@apple.com>
Thu, 20 May 2010 22:46:54 +0000 (22:46 +0000)
committerDan Gohman <gohman@apple.com>
Thu, 20 May 2010 22:46:54 +0000 (22:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104290 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopStrengthReduce.cpp

index 1f6ae6a7d943d1ba27cdb815d8221355611b43e6..86ea3eb6cdb04f89b1e5977c16e439af74f3a657 100644 (file)
@@ -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();