[InstCombine] Don't try to sink EH pad instructions
authorDavid Majnemer <david.majnemer@gmail.com>
Sat, 8 Aug 2015 03:51:49 +0000 (03:51 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Sat, 8 Aug 2015 03:51:49 +0000 (03:51 +0000)
Found by inspection, this change should not effect the existing
landingpad behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244391 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/InstCombine/InstructionCombining.cpp

index 45994d186f6aac9fdac237c791067043e97baeb6..734056d211870f456c77440412e4f43eb6b7e3a3 100644 (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;
       }