Skip to content

X86: force enable the mandatory tailcall on Win64 #6281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions clang/lib/Basic/Targets/X86.h
Original file line number Diff line number Diff line change
Expand Up @@ -819,11 +819,10 @@ class LLVM_LIBRARY_VISIBILITY WindowsX86_64TargetInfo
case CC_PreserveAll:
case CC_X86_64SysV:
case CC_Swift:
case CC_SwiftAsync:
case CC_X86RegCall:
case CC_OpenCLKernel:
return CCCR_OK;
case CC_SwiftAsync:
return CCCR_Error;
default:
return CCCR_Warning;
}
Expand Down
3 changes: 2 additions & 1 deletion llvm/lib/Target/X86/X86FrameLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,8 @@ void X86FrameLowering::emitPrologue(MachineFunction &MF,
// Space reserved for stack-based arguments when making a (ABI-guaranteed)
// tail call.
unsigned TailCallArgReserveSize = -X86FI->getTCReturnAddrDelta();
if (TailCallArgReserveSize && IsWin64Prologue)
if (TailCallArgReserveSize && IsWin64Prologue &&
!MF.getFunction().getAttributes().hasAttrSomewhere(Attribute::SwiftAsync))
report_fatal_error("Can't handle guaranteed tail call under win64 yet");

const bool EmitStackProbeCall =
Expand Down