From fa8681e45245be394a62fb1efae38f44d1884959 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 --- llvm/lib/Analysis/ScalarEvolutionExpander.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp index 921403d..1356fdc 100644 --- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp +++ b/llvm/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; -- 2.7.4