JIT: Check for call interference when placing PUTARG nodes#103301
Merged
jakobbotsch merged 8 commits intodotnet:mainfrom Jun 26, 2024
Merged
JIT: Check for call interference when placing PUTARG nodes#103301jakobbotsch merged 8 commits intodotnet:mainfrom
jakobbotsch merged 8 commits intodotnet:mainfrom
Conversation
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
This was referenced Jun 12, 2024
Member
Author
Member
Author
|
/azp run runtime-coreclr jitstress, runtime-coreclr libraries-jitstress |
|
Azure Pipelines successfully started running 2 pipeline(s). |
Member
|
Btw, I wonder if it makes sense to introduce an assert that certain types of helper calls (backed by managed impl or with safe points) never appear in nogc regions |
Member
Author
Probably would, but note that the call arg setup isn't in a nogc region, so it wouldn't have caught this bug. |
Member
Author
To ensure these maintain their relative ordering with their operand PUTARG nodes that may have been moved.
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This adds a legalization pass for call argument
PUTARGnodes after they have been created. We currently insert PUTARG_* nodes right after argument definitions, which is usually a good placement because morph ensured that this was ok.However, due to LIR transformations this placement might not be legal if there are any calls after the node. This PR moves the PUTARG_* nodes ahead of those interfering calls when they exist.
For example, for the case in #102919 we now end up with:
without this change the
PUTARG_STKnodes end up before theBULKWRITEBARRIERcall.The algorithm works by first marking all
PUTARGoperand nodes of the call, and then walking backwards from the call in linear order until we have visited all marked nodes.If we see any call before visiting all marked nodes then we have found an interfering call, and the remaining
PUTARG_nodes need to be moved after it.Fix #103300
Fix #102919
Fix #104042