Index: llvm/trunk/include/llvm/Analysis/LoopInfoImpl.h =================================================================== --- llvm/trunk/include/llvm/Analysis/LoopInfoImpl.h +++ llvm/trunk/include/llvm/Analysis/LoopInfoImpl.h @@ -252,6 +252,8 @@ HasInsideLoopSuccs = true; break; } + assert(HasInsideLoopSuccs && "Loop block has no in-loop successors!"); + typedef GraphTraits > InvBlockTraits; for (typename InvBlockTraits::ChildIteratorType PI = InvBlockTraits::child_begin(BB), PE = InvBlockTraits::child_end(BB); @@ -262,6 +264,7 @@ else OutsideLoopPreds.push_back(N); } + assert(HasInsideLoopPreds && "Loop block has no in-loop predecessors!"); if (BB == getHeader()) { assert(!OutsideLoopPreds.empty() && "Loop is unreachable!"); @@ -275,8 +278,6 @@ assert(CB != OutsideLoopPreds[i] && "Loop has multiple entry points!"); } - assert(HasInsideLoopPreds && "Loop block has no in-loop predecessors!"); - assert(HasInsideLoopSuccs && "Loop block has no in-loop successors!"); assert(BB != &getHeader()->getParent()->front() && "Loop contains function entry block!");