Skip to content
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

Fix fast tail calls on Windows ARM64. #37192

Merged
merged 1 commit into from
May 30, 2020

Conversation

erozenfeld
Copy link
Member

LowerFastTailCall has code that looks for incoming stack arguments
that may be overwritten by outgoing stack arguments and copies
them to a temp. The logic was incorrect for Windows Arm64 because it was
assuming shadow space, which only exists in Windows x64 abi.

Fixes #31729.
Fixes #36911.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label May 30, 2020
@erozenfeld
Copy link
Member Author

@BruceForstall @dotnet/jit-contrib PTAL

@erozenfeld erozenfeld changed the title Fix fast tail calls on ARM64. Fix fast tail calls on Windows ARM64. May 30, 2020
@@ -1883,7 +1883,7 @@ void Lowering::LowerFastTailCall(GenTreeCall* call)
continue;
}

#if defined(TARGET_WINDOWS) && defined(TARGET_64BIT)
#if defined(TARGET_WINDOWS) && defined(TARGET_AMD64)
// On Win64, the argument position determines the stack slot uniquely, and even the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Fix the comment?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

LowerFastTailCall has code that looks for incoming stack arguments
that may be overwritten by outgoing stack arguments and copies
them to a temp. The logic was incorrect for Windows Arm64 because it was
assuming shadow space, which only exists in Windows x64 abi.

Fixes dotnet#31729.
Fixes dotnet#36911.
@jkotas
Copy link
Member

jkotas commented May 30, 2020

Test failures are tracked by #35068 and #37132

@jkotas jkotas merged commit c22d94f into dotnet:master May 30, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Arm64] tailcall bad codegen tailcalls_do / tailcalls_d fail on Windows ARM64
5 participants