Index: lib/Analysis/LoopInfo.cpp =================================================================== --- lib/Analysis/LoopInfo.cpp +++ lib/Analysis/LoopInfo.cpp @@ -545,6 +545,7 @@ assert((FoundIB || !DFS.hasPostorder(*I)) && "should have seen IB"); FoundIB = true; } + assert(Unloop && "does not contain any loop"); if (L != Unloop && Unloop->contains(L)) { // Successor is in a subloop. if (Subloop) Index: lib/Analysis/ScalarEvolution.cpp =================================================================== --- lib/Analysis/ScalarEvolution.cpp +++ lib/Analysis/ScalarEvolution.cpp @@ -5554,6 +5554,8 @@ if (NumExits == 1) return; + assert(ENT && "ExitNotTakenExtras is NULL while having more than one exit"); + auto &Exits = ExitNotTaken.ExtraInfo->Exits; // Handle the rare case of multiple computable exits.