Skip to content

Comments

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 <62474226+SingleAccretion@users.noreply.github.com>
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.

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