diff options
| author | Bill Wendling <isanbard@gmail.com> | 2011-09-01 01:16:58 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2011-09-01 01:16:58 +0000 |
| commit | 2d1f11f743d820f8896abfec1391aa848d191e31 (patch) | |
| tree | b807c3115711527ba98312d25c0d535086703a7b /llvm/lib/Transforms | |
| parent | 3555b5d7178347a1640c2eddbcbe2d521165c1f1 (diff) | |
| download | bcm5719-llvm-2d1f11f743d820f8896abfec1391aa848d191e31.tar.gz bcm5719-llvm-2d1f11f743d820f8896abfec1391aa848d191e31.zip | |
Don't DCE the landingpad instruction.
The landingpad instruction can be removed only when its invokes are removed.
llvm-svn: 138930
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp index 838678b9fab..4eea2ff3951 100644 --- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/llvm/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. |

