Skip the insertion iterator past the landingpad instruction if there.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137626 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp
index 17beeb5..c274b15 100644
--- a/lib/Transforms/Scalar/CodeGenPrepare.cpp
+++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp
@@ -411,6 +411,7 @@
 
     if (!InsertedCast) {
       BasicBlock::iterator InsertPt = UserBB->getFirstNonPHI();
+      if (isa<LandingPadInst>(InsertPt)) ++InsertPt;
 
       InsertedCast =
         CastInst::Create(CI->getOpcode(), CI->getOperand(0), CI->getType(), "",