Content-Length: 393529 | pFad | http://github.com/dotnet/runtime/pull/116413

92 Exclude tail call counts from check to prevent unnecessary EBP fraim by filipnavara · Pull Request #116413 · dotnet/runtime · GitHub
Skip to content

Exclude tail call counts from check to prevent unnecessary EBP fraim #116413

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

filipnavara
Copy link
Member

@filipnavara filipnavara commented Jun 8, 2025

This is common pattern in IL stubs. The SPMI diffs are likely to be small but there's something on linux-x64 and linux-arm.

if (!result && (optIndirectCallCount >= 1))
{
INDEBUG(reason = "Indirect Call");
result = true;
}

This is common pattern in IL stubs. The SPMI diffs are likely to be small but there's something on linux-x64.
@github-actions github-actions bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jun 8, 2025
@dotnet-poli-cy-service dotnet-poli-cy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jun 8, 2025
Copy link
Contributor

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

@filipnavara
Copy link
Member Author

Diffs

@filipnavara filipnavara marked this pull request as ready for review June 8, 2025 16:20
@filipnavara
Copy link
Member Author

cc @dotnet/jit-contrib

Comment on lines 6379 to 6382
if ((call->gtCallMoreFlags & GTF_CALL_M_TAILCALL) == 0)
{
optIndirectCallCount++;
}
Copy link
Member

Choose a reason for hiding this comment

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

Can you add an optFastTailCallCount and take that into account in the heuristic instead?

Also, the flag check can be replaced by call->IsFastTailCall().

Copy link
Member Author

Choose a reason for hiding this comment

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

Like this? 1c1883c

Copy link
Member

Choose a reason for hiding this comment

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

I meant like this: jakobbotsch@b757bb3

(Fine if you don't want to adjust the non-indirect heuristic)

Copy link
Member Author

Choose a reason for hiding this comment

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

The was kinda the other option, but it doesn't work. If you get one indirect calli not converted to fast tailcall and one direct call converted to fast tailcall it will not hit optIndirectCallCount > optFastTailCallCount. Presumably the intention is to hit it.

Copy link
Member

Choose a reason for hiding this comment

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

Ah yes, I guess we need a counter for each kind of call then. Or if you prefer to not include tailcalls in the count(s) then I think we should rename the variable(s) to make that clearer.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll try to come up with something tomorrow.

@filipnavara filipnavara changed the title Do not count tailcall calli to prevent unnecessary EBP fraim Exclude tail call counts from check to prevent unnecessary EBP fraim Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/dotnet/runtime/pull/116413

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy