Don't try to sink the landingpad instruction. It's immobile.
authorBill Wendling <isanbard@gmail.com>
Mon, 15 Aug 2011 18:23:40 +0000 (18:23 +0000)
committerBill Wendling <isanbard@gmail.com>
Mon, 15 Aug 2011 18:23:40 +0000 (18:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137629 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/InstCombine/InstructionCombining.cpp

index 41d542af685aee7bad14d24e8440209426b8ea60..32c55a3408d23b6d2a7404eaa60337798ba763f5 100644 (file)
@@ -1417,8 +1417,9 @@ Instruction *InstCombiner::visitExtractValueInst(ExtractValueInst &EV) {
 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) || I->mayHaveSideEffects() || isa<TerminatorInst>(I))
+  // Cannot move control-flow-involving, volatile loads, vaarg, landingpad, etc.
+  if (isa<PHINode>(I) || isa<LandingPadInst>(I) || I->mayHaveSideEffects() ||
+      isa<TerminatorInst>(I))
     return false;
 
   // Do not sink alloca instructions out of the entry block.