JIT: Simplify gtHasLocalsWithAddrOp - #131756
Closed
jakobbotsch wants to merge 1 commit into
Closed
Conversation
In all places that use this we only need to check for LCL_VAR and LCL_FLD, and this simplifies multiple callers that workaround this returning true for `LCL_ADDR` nodes.
|
Azure Pipelines: Successfully started running 5 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refines the JIT helper that detects references to locals involved in address operations by narrowing it to value uses (GT_LCL_VAR / GT_LCL_FLD) and updating all call sites to use the new semantics.
Changes:
- Replace
gtHasLocalsWithAddrOpwithgtHasLocalValueWithAddrOp, excludingGT_LCL_ADDRand local stores from consideration. - Update importer, indirect-call transformation, and FG optimization logic to use the new helper and drop now-unnecessary special-casing.
- Adjust documentation/comments around the helper to reflect the new, narrower contract.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/jit/indirectcalltransformer.cpp | Uses the new helper to avoid conservatively spilling args based on GT_LCL_ADDR. |
| src/coreclr/jit/importer.cpp | Simplifies spill / interference / inline-arg classification checks to align with value-only local detection. |
| src/coreclr/jit/gentree.cpp | Renames and tightens the tree-walk helper to only consider GT_LCL_VAR/GT_LCL_FLD nodes. |
| src/coreclr/jit/fgopt.cpp | Updates early-reordering logic to synthesize GTF_GLOB_REF based on the refined helper. |
| src/coreclr/jit/compiler.h | Renames the helper declaration to match the new API. |
Member
Author
|
Not that simple since the tree can have indirections of a local address too, which we need to check for, so this just moves the complexity into |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In all places that use this we only need to check for LCL_VAR and LCL_FLD, and this simplifies multiple callers that workaround this returning true for
LCL_ADDRnodes.Alternative to #131754.