From 1178fb47018fea531c91ee04e39f30607122e763 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 15 Aug 2011 18:21:07 +0000 Subject: [PATCH] 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 --- lib/Transforms/Scalar/CodeGenPrepare.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp index 17beeb5aa84..c274b1595a7 100644 --- a/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -411,6 +411,7 @@ static bool OptimizeNoopCopyExpression(CastInst *CI, const TargetLowering &TLI){ if (!InsertedCast) { BasicBlock::iterator InsertPt = UserBB->getFirstNonPHI(); + if (isa(InsertPt)) ++InsertPt; InsertedCast = CastInst::Create(CI->getOpcode(), CI->getOperand(0), CI->getType(), "", -- 2.34.1