[InstCombine] Don't try to sink EH pad instructions

Found by inspection, this change should not effect the existing
landingpad behavior.

llvm-svn: 244391
This commit is contained in:
David Majnemer 2015-08-08 03:51:49 +00:00
parent 67c4df8313
commit 60c994b985
1 changed files with 2 additions and 2 deletions

View File

@ -2672,7 +2672,7 @@ static bool TryToSinkInstruction(Instruction *I, BasicBlock *DestBlock) {
assert(I->hasOneUse() && "Invariants didn't hold!");
// Cannot move control-flow-involving, volatile loads, vaarg, etc.
if (isa<PHINode>(I) || isa<LandingPadInst>(I) || I->mayHaveSideEffects() ||
if (isa<PHINode>(I) || I->isEHPad() || I->mayHaveSideEffects() ||
isa<TerminatorInst>(I))
return false;
@ -2975,7 +2975,7 @@ static bool prepareICWorklistFromFunction(Function &F, const DataLayout &DL,
Instruction *Inst = --I;
if (!Inst->use_empty())
Inst->replaceAllUsesWith(UndefValue::get(Inst->getType()));
if (isa<LandingPadInst>(Inst)) {
if (Inst->isEHPad()) {
EndInst = Inst;
continue;
}