-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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] x86/x64 - improved localloc codegen in some cases #76851
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsDescription The x86 emitter keeps track of the stack whenever it sees the pattern The change adds a new instruction, // Does not affect the stack tracking in the emitter
INST5(push_hide, "push", IUM_RD, 0x0030FE, 0x000068, BAD_CODE, BAD_CODE, 0x000050, INS_FLAGS_None )
INST5(pop_hide, "pop", IUM_WR, 0x00008E, BAD_CODE, BAD_CODE, BAD_CODE, 0x000058, INS_FLAGS_None ) Acceptance Criteria
|
@dotnet/jit-contrib This is ready assuming CI succeeds. cc @BruceForstall |
Could you paste sample diffs? |
/azp run runtime-coreclr outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
@BruceForstall Outerloop did pass, apart from the formatting failures. |
@BruceForstall I've made changes to |
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.
Couple more comments
Co-authored-by: Bruce Forstall <brucefo@microsoft.com>
Co-authored-by: Bruce Forstall <brucefo@microsoft.com>
@dotnet/jit-contrib This is ready again. |
Description
Should resolve: #6546
@BruceForstall and I went through this, and it turns out that it was actually quite simple.
The x86/x64 emitter keeps track of the stack whenever it sees the pattern
sub esp
, but there are cases where we do not want to do this. To prevent it from keeping track, it would moveesp
into a temporary register, dosub
with that register, and then move it back toesp
. This causes two extra instructions to be emitted for x86 under this scenario.The change adds a new instruction,
INS_sub_hide
, that does the same thing assub
, but will tell the emitter not to track the stack. We already have other instructions to do this exact thing already withpush
andpop
:Example diff:
Acceptance Criteria
regTmp
fromgenStackPointerConstantAdjustment
and possibly further up.