[llvm-commits] [llvm] r138930 - /llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp

Bill Wendling isanbard at gmail.com
Wed Aug 31 18:16:58 PDT 2011


Author: void
Date: Wed Aug 31 20:16:58 2011
New Revision: 138930

URL: http://llvm.org/viewvc/llvm-project?rev=138930&view=rev
Log:
Don't DCE the landingpad instruction.

The landingpad instruction can be removed only when its invokes are removed.

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=138930&r1=138929&r2=138930&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp Wed Aug 31 20:16:58 2011
@@ -1577,6 +1577,11 @@
         while (Term != BB->begin()) {   // Remove instrs bottom-up
           BasicBlock::iterator I = Term; --I;
 
+          // Don't remove the landingpad instruction. This should be removed
+          // only if its invokes are also removed.
+          if (isa<LandingPadInst>(I))
+            continue;
+
           DEBUG(errs() << "IC: DCE: " << *I << '\n');
           // A debug intrinsic shouldn't force another iteration if we weren't
           // going to do one without it.





More information about the llvm-commits mailing list