[ScalarEvolutionExpander] Simplify findInsertPointAfter

No functional change is intended.  The loop could only execute, at most,
once.

llvm-svn: 259701
This commit is contained in:
David Majnemer 2016-02-03 21:30:31 +00:00
parent eb3bcdd28b
commit fa8681e452
1 changed files with 6 additions and 8 deletions

View File

@ -95,14 +95,12 @@ static BasicBlock::iterator findInsertPointAfter(Instruction *I,
while (isa<PHINode>(IP))
++IP;
while (IP->isEHPad()) {
if (isa<FuncletPadInst>(IP) || isa<LandingPadInst>(IP)) {
++IP;
} else if (isa<CatchSwitchInst>(IP)) {
IP = MustDominate->getFirstInsertionPt();
} else {
llvm_unreachable("unexpected eh pad!");
}
if (isa<FuncletPadInst>(IP) || isa<LandingPadInst>(IP)) {
++IP;
} else if (isa<CatchSwitchInst>(IP)) {
IP = MustDominate->getFirstInsertionPt();
} else {
assert(!IP->isEHPad() && "unexpected eh pad!");
}
return IP;