-
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
Improve impPopCallArgs #68736
Merged
Merged
Improve impPopCallArgs #68736
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ghost
assigned jakobbotsch
Apr 30, 2022
dotnet-issue-labeler
bot
added
the
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
label
Apr 30, 2022
Tagging subscribers to this area: @JulieLeeMSFT Issue Detailsnull
|
cc @dotnet/jit-contrib |
Merged
/azp run runtime-coreclr jitstress, runtime-coreclr libraries-jitstress |
Azure Pipelines successfully started running 2 pipeline(s). |
PTAL @AndyAyersMS |
jakobbotsch
commented
May 3, 2022
And use it from impPopCallArgs to avoid O(n^2) in checked builds
AndyAyersMS
approved these changes
May 6, 2022
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Today
impPopCallArgs
works in the following way:impNormStructVal
withCHECK_SPILL_ALL
, which is necessary because we are normalizing the arguments in reverse orderWhen this is done, we loop through the arg list in order and walk the signature at the same time. We check that the implicit type coercions between the arg types and signature types are ok, and we insert some implicit casts and
GT_PUTARG_TYPE
.This PR changes the loop to always walk the arguments on the stack in order. That means instead of popping arguments from the top of the stack and thus walking the arguments backwards, we start from the beginning. The benefit is that we can then walk the signature at the same time. Furthermore, when calling
impNormStructVal
we now only check interference with the stack entries that are not arguments since we now know that arguments will be normalized and kept in order.While the fewer interference checks result in only small diffs, the main benefit of this change is that it will help the logic for an upcoming change where I want to consistently store signature types and class handles in
CallArg
. Having access to the signature when we create the args in the first place simplifies things.Furthermore, I have cleaned things up a little bit by removing the possibility of
sig
being null. There was only one caller passing this, for a helper, and it can simply pop the arguments on its own.