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

JIT: Make stack size computation in fgCanFastTailCall more precise #103538

Merged

Conversation

jakobbotsch
Copy link
Member

@jakobbotsch jakobbotsch commented Jun 16, 2024

Two changes:

  1. Skip applying alignment when computing a call's arg stack size, which does not make sense/is not correct
  2. Round up the incoming parameter stack space in terms of number of slots

Without (1) we overestimate the stack size usage for some calls. Without (2) we underestimate the incoming stack size for some methods. Both of these just result in fewer tailcalls than possible, so cause no correctness issues. However, I hit some diffs in #103537 because of them.

Applying the alignment of arguments that are not passed on stack does
not make sense/is not correct.
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jun 16, 2024
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@jakobbotsch jakobbotsch marked this pull request as ready for review June 16, 2024 18:16
@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @EgorBo

Diffs

@jakobbotsch jakobbotsch requested a review from EgorBo June 16, 2024 18:17
@jakobbotsch jakobbotsch merged commit e976830 into dotnet:main Jun 17, 2024
105 of 107 checks passed
@jakobbotsch jakobbotsch deleted the fast-tailcall-stack-size-alignment branch June 17, 2024 07:42
@github-actions github-actions bot locked and limited conversation to collaborators Jul 17, 2024
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.

2 participants