diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp index dd8e2ddef43..6e808919512 100644 --- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp @@ -3337,15 +3337,9 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI, assert(FPDiff % 16 == 0 && "unaligned stack on tail call"); } - // We can omit callseq_start/callseq_end if there is no callframe to setup. - // Do not omit for patchpoints as SelectionDAGBuilder::visitPatchpoint() - // currently expects it. - bool OmitCallSeq = NumBytes == 0 && !CLI.IsPatchPoint; - assert((!IsSibCall || OmitCallSeq) && "Should not get callseq for sibcalls"); - // Adjust the stack pointer for the new arguments... // These operations are automatically eliminated by the prolog/epilog pass - if (!OmitCallSeq) + if (!IsSibCall) Chain = DAG.getCALLSEQ_START(Chain, NumBytes, 0, DL); SDValue StackPtr = DAG.getCopyFromReg(Chain, DL, AArch64::SP, @@ -3511,7 +3505,7 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI, // the frame up *after* the call, however in the ABI-changing tail-call case // we've carefully laid out the parameters so that when sp is reset they'll be // in the correct location. - if (IsTailCall && !OmitCallSeq) { + if (IsTailCall && !IsSibCall) { Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(NumBytes, DL, true), DAG.getIntPtrConstant(0, DL, true), InFlag, DL); InFlag = Chain.getValue(1); @@ -3569,11 +3563,9 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI, uint64_t CalleePopBytes = DoesCalleeRestoreStack(CallConv, TailCallOpt) ? alignTo(NumBytes, 16) : 0; - if (!OmitCallSeq) - Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(NumBytes, DL, true), - DAG.getIntPtrConstant(CalleePopBytes, DL, true), - InFlag, DL); - + Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(NumBytes, DL, true), + DAG.getIntPtrConstant(CalleePopBytes, DL, true), + InFlag, DL); if (!Ins.empty()) InFlag = Chain.getValue(1); |