From: Bill Wendling Date: Thu, 1 Sep 2011 01:16:58 +0000 (+0000) Subject: Don't DCE the landingpad instruction. X-Git-Tag: android-x86-6.0-r1~928^2~1702 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=1893cd31313d240279b3d65b24bc1d69003e9bc5;p=android-x86%2Fexternal-llvm.git 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 --- diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp index 838678b9fab..4eea2ff3951 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(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.