diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp index c0389df5b735..47bf107e66e4 100644 --- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp +++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp @@ -885,8 +885,8 @@ DoPromotion(Function *F, SmallPtrSetImpl &ArgsToPromote, cast(New)->setCallingConv(CS.getCallingConv()); cast(New)->setAttributes(AttributeSet::get(New->getContext(), AttributesVec)); - if (cast(Call)->isTailCall()) - cast(New)->setTailCall(); + cast(New)->setTailCallKind( + cast(Call)->getTailCallKind()); } New->setDebugLoc(Call->getDebugLoc()); Args.clear(); diff --git a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp index c294d6450b59..1a5ed4692211 100644 --- a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp +++ b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp @@ -190,8 +190,8 @@ bool DeadArgumentEliminationPass::DeleteDeadVarargs(Function &Fn) { New = CallInst::Create(NF, Args, OpBundles, "", Call); cast(New)->setCallingConv(CS.getCallingConv()); cast(New)->setAttributes(PAL); - if (cast(Call)->isTailCall()) - cast(New)->setTailCall(); + cast(New)->setTailCallKind( + cast(Call)->getTailCallKind()); } New->setDebugLoc(Call->getDebugLoc()); @@ -896,8 +896,8 @@ bool DeadArgumentEliminationPass::RemoveDeadStuffFromFunction(Function *F) { New = CallInst::Create(NF, Args, OpBundles, "", Call); cast(New)->setCallingConv(CS.getCallingConv()); cast(New)->setAttributes(NewCallPAL); - if (cast(Call)->isTailCall()) - cast(New)->setTailCall(); + cast(New)->setTailCallKind( + cast(Call)->getTailCallKind()); } New->setDebugLoc(Call->getDebugLoc()); diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp index c9eecf3ea772..c79aa05c39ea 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -3043,8 +3043,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) { CallInst *CI = cast(Caller); NC = Builder->CreateCall(Callee, Args, OpBundles); NC->takeName(CI); - if (CI->isTailCall()) - cast(NC)->setTailCall(); + cast(NC)->setTailCallKind(CI->getTailCallKind()); cast(NC)->setCallingConv(CI->getCallingConv()); cast(NC)->setAttributes(NewCallerPAL); } @@ -3228,10 +3227,10 @@ InstCombiner::transformCallThroughTrampoline(CallSite CS, cast(NewCaller)->setAttributes(NewPAL); } else { NewCaller = CallInst::Create(NewCallee, NewArgs, OpBundles); - if (cast(Caller)->isTailCall()) - cast(NewCaller)->setTailCall(); - cast(NewCaller)-> - setCallingConv(cast(Caller)->getCallingConv()); + cast(NewCaller)->setTailCallKind( + cast(Caller)->getTailCallKind()); + cast(NewCaller)->setCallingConv( + cast(Caller)->getCallingConv()); cast(NewCaller)->setAttributes(NewPAL); } diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp index fbb2483e8866..1de742050cb3 100644 --- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp +++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp @@ -1395,7 +1395,7 @@ makeStatepointExplicitImpl(const CallSite CS, /* to replace */ StatepointID, NumPatchBytes, CallTarget, Flags, CallArgs, TransitionArgs, DeoptArgs, GCArgs, "safepoint_token"); - Call->setTailCall(ToReplace->isTailCall()); + Call->setTailCallKind(ToReplace->getTailCallKind()); Call->setCallingConv(ToReplace->getCallingConv()); // Currently we will fail on parameter attributes and on certain