From e08ae5f43b8b13963cf995ae848d0bf33832b818 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Wed, 3 Feb 2016 21:30:31 +0000 Subject: [PATCH] [ScalarEvolutionExpander] Simplify findInsertPointAfter No functional change is intended. The loop could only execute, at most, once. llvm-svn: 259701 --- lib/Analysis/ScalarEvolutionExpander.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) 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;