diff --git a/lib/Analysis/ScalarEvolutionExpander.cpp b/lib/Analysis/ScalarEvolutionExpander.cpp index 921403ddc0f..1356fdced41 100644 --- a/lib/Analysis/ScalarEvolutionExpander.cpp +++ b/lib/Analysis/ScalarEvolutionExpander.cpp @@ -95,14 +95,12 @@ static BasicBlock::iterator findInsertPointAfter(Instruction *I, while (isa(IP)) ++IP; - while (IP->isEHPad()) { - if (isa(IP) || isa(IP)) { - ++IP; - } else if (isa(IP)) { - IP = MustDominate->getFirstInsertionPt(); - } else { - llvm_unreachable("unexpected eh pad!"); - } + if (isa(IP) || isa(IP)) { + ++IP; + } else if (isa(IP)) { + IP = MustDominate->getFirstInsertionPt(); + } else { + assert(!IP->isEHPad() && "unexpected eh pad!"); } return IP;