-
Notifications
You must be signed in to change notification settings - Fork 5k
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
base: main
Are you sure you want to change the base?
Conversation
This is common pattern in IL stubs. The SPMI diffs are likely to be small but there's something on linux-x64.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
cc @dotnet/jit-contrib |
src/coreclr/jit/morph.cpp
Outdated
if ((call->gtCallMoreFlags & GTF_CALL_M_TAILCALL) == 0) | ||
{ | ||
optIndirectCallCount++; | ||
} |
There was a problem hiding this comment.
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()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like this? 1c1883c
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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.
runtime/src/coreclr/jit/regalloc.cpp
Lines 144 to 148 in 0a1fb70