-
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: Remove CallArg::m_tmpNum
#104429
JIT: Remove CallArg::m_tmpNum
#104429
Conversation
Before this change the JIT has two places where it may introduce temps during call args morphing: 1. Directly during `fgMorphArgs` as part of making struct copies for some struct args, like implicit byref args and other struct args requiring to be of `LCL_VAR` shape 2. During `EvalArgsToTemps` as part of making sure evaluation order is maintained while we get the call into the right shape with registers To make this work we have `CallArg::m_tmpNum` that communicates the local from 1 to 2; the responsibility of creating the actual `LCL_VAR` node to put in the late argument list was left to `EvalArgsToTemps` while `fgMorphArgs` would just change the early setup node to a store into the temporary. This PR changes it so that 1 directly introduces the right late node when it creates its temporary. That is, it puts the call argument into the right shape immediately and avoids relying on `EvalArgsToTemps` to create the local node in the late list. The benefit of that is that we no longer need to communicate the temporary as part of every `CallArg`. However, the motivation here is something else: as part of dotnet#104370 we may have arguments that need multiple temporaries to copy, so having things working in this way introduces complications for that.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
|
||
if (argx == nullptr) | ||
{ | ||
// Should only happen if remorphing in which case we do not need to | ||
// make a decision about temps. | ||
continue; | ||
} |
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.
ArgsComplete
is not called during remorphing, so the code should be dead.
@@ -3264,29 +3222,31 @@ void Compiler::fgMakeOutgoingStructArgCopy(GenTreeCall* call, CallArg* arg) | |||
assert(!fgGlobalMorph); | |||
} | |||
|
|||
call->gtArgs.SetNeedsTemp(arg); |
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.
This was previously done in ArgsComplete
(the code in the GTF_ASG
case), but it makes more sense just to do it immediately when we introduce the temp.
/azp run runtime-coreclr superpmi-diffs |
Azure Pipelines successfully started running 1 pipeline(s). |
Ping @EgorBo |
This reverts commit 7029008.
The JIT currently has two places where it may introduce temps during call args morphing:
fgMorphArgs
as part of making struct copies for some struct args, like implicit byref args and other struct args requiring to be ofLCL_VAR
shapeEvalArgsToTemps
as part of making sure evaluation order is maintained while we get the call into the right shape with registersTo make this work we have
CallArg::m_tmpNum
that communicates the local from 1 to 2; the responsibility of creating the actualLCL_VAR
node to put in the late argument list was left toEvalArgsToTemps
whilefgMorphArgs
would just change the early setup node to a store into the temporary.This PR changes it so that 1 directly introduces the right late node when it creates its temporary. That is, it puts the call argument into the right shape immediately and avoids relying on
EvalArgsToTemps
to create the local node in the late list.The benefit of that is that we no longer need to communicate the temporary as part of every
CallArg
. However, the motivation here is something else: as part of #104370 we may have arguments that need multiple temporaries to copy, so having things working in this way introduces complications for that.No diffs are expected.