Repository navigation
JIT: Strengthen GTF_GLOB_REF checking - #137046
Merged
Merged
Conversation
Check required flags after global morph and add missing flags exposed by the stronger checks. Prerequisite for enabling stronger checking after earlier phases, which is itself a prerequisite for simplifying forward substitution's analysis. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 29dec1dd-b421-4959-8321-a562ad76eff2
|
Azure Pipelines: Successfully started running 5 pipeline(s). 10 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 |
Member
Author
|
ptal @dotnet/jit-contrib |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the JIT global-reference validation and flag-maintenance changes.
No open issues 🎉
What changed in this PR
This PR strengthens the JIT’s GTF_GLOB_REF validation after global morph and repairs flag maintenance exposed by the stricter checks. It prepares for earlier-phase validation without changing forward substitution.
Changes:
- Centralizes the local-variable flag requirement for validation and node creation.
- Preserves required flags across local transformations, volatile field accesses, allocation helpers, intrinsic fallbacks, and patchpoints.
- Adds post-global-morph checks and updates a related explanatory comment.
| File | Description |
|---|---|
src/coreclr/jit/patchpoint.cpp |
Adds global-reference flags to both patchpoint forms. |
src/coreclr/jit/objectalloc.cpp |
Marks allocation helpers with side effects as global references. |
src/coreclr/jit/morphblock.cpp |
Uses flag-aware local-node creation for field copies. |
src/coreclr/jit/morph.cpp |
Establishes address exposure earlier and preserves required local flags. |
src/coreclr/jit/importer.cpp |
Preserves global-reference flags on volatile field indirections. |
src/coreclr/jit/gentree.cpp |
Applies shared local requirements and flags intrinsic fallbacks. |
src/coreclr/jit/fgdiagnostic.cpp |
Checks required global-reference flags after global morph. |
src/coreclr/jit/copyprop.cpp |
Adds required flags when replacing a local reference. |
src/coreclr/jit/compiler.h |
Defines the shared local-descriptor flag requirement. |
src/coreclr/jit/boundscheckcoalesce.cpp |
Removes an outdated comment about effect-query restrictions. |
Review effort: Balanced
Member
Author
|
x86 replay failures noted above are a cross-bitness artifact, on an x64 host the profile data histogram layout is no longer what is expected. |
jakobbotsch
approved these changes
Nov 6, 2026
This was referenced Nov 6, 2026
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.
Check required
GTF_GLOB_REFflags after global morph and add missing flags exposed by the stronger checks. Share the local descriptor requirement between checking and node creation, and repair flag maintenance for local accesses, volatile field indirections, allocation helpers, intrinsic fallbacks, and patchpoints.This is groundwork for enabling stronger checking after earlier phases, and eventually simplifying forward substitution's analysis. No forward-sub changes here.
Validation
.\build.cmd clr.alljits -c Checked: passed.jit-formatchecks, including clang-format and clang-tidy: passed.SuperPMI replay using
superpmi.py:No new x86 compilation failures. The x64 capture miss is also present in the baseline.
Windows x64 code size
superpmi.py asmdiffsagainst the unchanged base commit completed with no compilation failures on either JIT. 55 of 2,081,803 successfully compiled contexts have diffs.diffs
Note
This PR description was generated with GitHub Copilot.