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

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 7 20:51:49 PDT 2015


Author: majnemer
Date: Fri Aug  7 22:51:49 2015
New Revision: 244391

URL: http://llvm.org/viewvc/llvm-project?rev=244391&view=rev
Log:
[InstCombine] Don't try to sink EH pad instructions

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

Modified:
    llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp

Modified: llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp?rev=244391&r1=244390&r2=244391&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp Fri Aug  7 22:51:49 2015
@@ -2672,7 +2672,7 @@ static bool TryToSinkInstruction(Instruc
   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 prepareICWorklistFromFunctio
       Instruction *Inst = --I;
       if (!Inst->use_empty())
         Inst->replaceAllUsesWith(UndefValue::get(Inst->getType()));
-      if (isa<LandingPadInst>(Inst)) {
+      if (Inst->isEHPad()) {
         EndInst = Inst;
         continue;
       }




More information about the llvm-commits mailing list