镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

JIT: Strengthen GTF_GLOB_REF checking - #137046

Merged
AndyAyersMS merged 1 commit into
dotnet:mainfrom
AndyAyersMS:jit-glob-ref-checks
Nov 6, 2026
Merged

AndyAyersMS merged 1 commit into
dotnet:mainfrom
AndyAyersMS:jit-glob-ref-checks

Conversation

@AndyAyersMS

@AndyAyersMS AndyAyersMS commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Check required GTF_GLOB_REF flags 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.
  • 80 targeted runtime assembly runs passed: 16 assemblies covering forward sub, assertion propagation, and localloc, each under five configurations.
  • Full jit-format checks, including clang-format and clang-tidy: passed.

SuperPMI replay using superpmi.py:

Target Collections Successful compilations Compilation failures Capture misses
Windows x64 4 2,081,803 0 1
Linux ARM64 5 2,313,024 0 0
Windows x86 4 1,872,496 53,207, all in the same contexts as the baseline 89,382

No new x86 compilation failures. The x64 capture miss is also present in the baseline.

Windows x64 code size

superpmi.py asmdiffs against the unchanged base commit completed with no compilation failures on either JIT. 55 of 2,081,803 successfully compiled contexts have diffs.

Bytes
Baseline 897,847,461
Changed 897,847,623
Delta +162 (+0.000018%)

diffs

Note

This PR description was generated with GitHub Copilot.

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
@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Nov 5, 2026
@azure-pipelines

Copy link
Copy Markdown
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.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@AndyAyersMS
AndyAyersMS requested a balanced review from Copilot November 5, 2026 20:36
@AndyAyersMS

Copy link
Copy Markdown
Member Author

ptal @dotnet/jit-contrib

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@AndyAyersMS

Copy link
Copy Markdown
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.

@AndyAyersMS
AndyAyersMS merged commit b0f7865 into dotnet:main Nov 6, 2026
130 of 132 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants