Skip to content

JIT: some GT_INDEX_ADDRs won't need throw helpers#124286

Merged
AndyAyersMS merged 3 commits intodotnet:mainfrom
AndyAyersMS:IndexAddrMayNotNeedThrowHelper
Feb 12, 2026
Merged

JIT: some GT_INDEX_ADDRs won't need throw helpers#124286
AndyAyersMS merged 3 commits intodotnet:mainfrom
AndyAyersMS:IndexAddrMayNotNeedThrowHelper

Conversation

@AndyAyersMS
Copy link
Member

Saves a bit of code size for unoptimized methods.

Also we should not see GT_ARR_ELEM post-morph.

Saves a bit of code size for unoptimized methods.

Also we should not see GT_ARR_ELEM post-morph.
Copilot AI review requested due to automatic review settings February 11, 2026 18:06
@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 Feb 11, 2026
@AndyAyersMS
Copy link
Member Author

fyi @dotnet/jit-contrib
@EgorBo PTAL

@dotnet-policy-service
Copy link
Contributor

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refines CoreCLR JIT throw-helper usage tracking to avoid conservatively marking range-check helpers as used when a GT_INDEX_ADDR doesn’t actually emit a bounds check (primarily benefiting MinOpts/unoptimized methods), and adds an invariant check that GT_ARR_ELEM should not appear post-morph.

Changes:

  • Only mark SCK_RNGCHK_FAIL as used for GT_INDEX_ADDR when IsBoundsChecked() is true.
  • Add a debug assertion that GT_ARR_ELEM should not exist after morph (and stop treating it as a range-check-helper user here).

Co-authored-by: SingleAccretion <[email protected]>
Copilot AI review requested due to automatic review settings February 12, 2026 15:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

@AndyAyersMS AndyAyersMS merged commit a533b4d into dotnet:main Feb 12, 2026
130 of 137 checks passed
iremyux pushed a commit to iremyux/dotnet-runtime that referenced this pull request Mar 2, 2026
Saves a bit of code size for unoptimized methods.

Also we should not see GT_ARR_ELEM post-morph.

---------

Co-authored-by: SingleAccretion <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators Mar 15, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants