Index: lib/Analysis/ScalarEvolutionExpander.cpp =================================================================== --- lib/Analysis/ScalarEvolutionExpander.cpp +++ lib/Analysis/ScalarEvolutionExpander.cpp @@ -1746,6 +1746,7 @@ if (I != InsertedExpressions.end()) return I->second; + assert(isSafeToExpand(S, SE) && "Attempt to expand something unsafe!"); SCEVInsertPointGuard Guard(Builder, this); Builder.SetInsertPoint(InsertPt);