aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/InstCombine/InstructionCombining.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-09-01 01:16:58 +0000
committerBill Wendling <isanbard@gmail.com>2011-09-01 01:16:58 +0000
commit1893cd31313d240279b3d65b24bc1d69003e9bc5 (patch)
treeff13477921ddfe9382fd468694aa1bdc9feb280d /lib/Transforms/InstCombine/InstructionCombining.cpp
parent65088e7d96c20f5068a0c0c6bf9223a82011709f (diff)
Don't DCE the landingpad instruction.
The landingpad instruction can be removed only when its invokes are removed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138930 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstructionCombining.cpp')
-rw-r--r--lib/Transforms/InstCombine/InstructionCombining.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp
index 838678b9fa..4eea2ff395 100644
--- a/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -1577,6 +1577,11 @@ bool InstCombiner::DoOneIteration(Function &F, unsigned Iteration) {
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.