Skip to content

Delete unused WBF_NoBarrier_CheckNotHeapInDebug and CORINFO_HELP_ASSIGN_REF_ENSURE_NONHEAP#128230

Merged
EgorBo merged 4 commits into
mainfrom
copilot/delete-unused-helper-functions
May 16, 2026
Merged

Delete unused WBF_NoBarrier_CheckNotHeapInDebug and CORINFO_HELP_ASSIGN_REF_ENSURE_NONHEAP#128230
EgorBo merged 4 commits into
mainfrom
copilot/delete-unused-helper-functions

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 14, 2026

Removes the unused WBF_NoBarrier_CheckNotHeapInDebug write barrier form and the associated CORINFO_HELP_ASSIGN_REF_ENSURE_NONHEAP JIT helper (JIT_WriteBarrierEnsureNonHeapTarget).

GCInfo::WBF_NoBarrier_CheckNotHeapInDebug is never produced by gcIsWriteBarrierCandidate (or anywhere else), so the helper is never emitted and all of its consumers are dead code paths.

Changes

  • JIT helper enum: removed CORINFO_HELP_ASSIGN_REF_ENSURE_NONHEAP from corinfo.h, CorInfoHelpFunc.cs, and jithelpers.h.
  • Write barrier form: removed WBF_NoBarrier_CheckNotHeapInDebug from jitgcinfo.h.
  • Dead consumers in JIT: simplified both genUseOptimizedWriteBarriers overloads and dropped the corresponding case from genWriteBarrierHelperForWriteBarrierForm in codegencommon.cpp; removed the case from the mutatesHeap analysis in utils.cpp; removed the WASM HELPER_SIG in codegenwasm.cpp.
  • VM helper: removed JIT_WriteBarrierEnsureNonHeapTarget declaration from vm/jitinterface.h and its implementation from vm/gchelpers.cpp.
  • JIT-EE GUID: bumped in jiteeversionguid.h since the CorInfoHelpFunc enum changed.

Validation

  • ./build.sh clr -rc checked succeeded with 0 warnings, 0 errors.

Note

This PR was authored with assistance from GitHub Copilot.

…GN_REF_ENSURE_NONHEAP

Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/f12f1f82-9c79-435d-a7cc-c641d3ab582c

Co-authored-by: EgorBo <523221+EgorBo@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 14, 2026 22:09
Copilot AI requested a review from EgorBo May 14, 2026 22:10
Copilot finished work on behalf of EgorBo May 14, 2026 22:10
@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 May 14, 2026
@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.

@EgorBo EgorBo marked this pull request as ready for review May 14, 2026 22:36
@EgorBo EgorBo requested a review from MichalStrehovsky as a code owner May 14, 2026 22:36
Copilot AI review requested due to automatic review settings May 14, 2026 22:36
Copy link
Copy Markdown
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

Removes a dead GC write barrier form and its corresponding JIT helper from the CoreCLR JIT/EE interface, simplifying write barrier selection and eliminating unused VM/JIT code paths.

Changes:

  • Deleted GCInfo::WBF_NoBarrier_CheckNotHeapInDebug and the CORINFO_HELP_ASSIGN_REF_ENSURE_NONHEAP helper (plus the VM entrypoint JIT_WriteBarrierEnsureNonHeapTarget).
  • Simplified JIT write-barrier helper selection and helper property classification by removing the now-unreachable cases.
  • Bumped the JIT/EE version GUID to reflect the CorInfoHelpFunc enum change.

Reviewed changes

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

Show a summary per file
File Description
src/coreclr/vm/jitinterface.h Removes the VM-side FCDECL for the deleted helper entrypoint.
src/coreclr/vm/gchelpers.cpp Deletes the unused JIT_WriteBarrierEnsureNonHeapTarget helper implementation.
src/coreclr/tools/Common/JitInterface/CorInfoHelpFunc.cs Removes the managed mirror enum entry for CORINFO_HELP_ASSIGN_REF_ENSURE_NONHEAP.
src/coreclr/jit/utils.cpp Drops the helper from HelperCallProperties mutation classification.
src/coreclr/jit/jitgcinfo.h Removes the unused write barrier form enum value and its explanatory comment block.
src/coreclr/jit/codegenwasm.cpp Removes the WASM helper signature entry for the deleted helper.
src/coreclr/jit/codegencommon.cpp Removes dead write-barrier selection cases and simplifies optimized write-barrier checks.
src/coreclr/inc/jithelpers.h Removes the helper mapping entry from the JIT helper table.
src/coreclr/inc/jiteeversionguid.h Updates the JIT/EE interface GUID due to CorInfoHelpFunc enum change.
src/coreclr/inc/corinfo.h Removes the CorInfoHelpFunc enum member CORINFO_HELP_ASSIGN_REF_ENSURE_NONHEAP.

@jkotas
Copy link
Copy Markdown
Member

jkotas commented May 15, 2026

Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/b7ce8ca9-f443-404b-9304-bf6f47e40d39

Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 15, 2026 06:44
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 15, 2026

@copilot Apply the formatting patch from https://github.com/dotnet/runtime/actions/runs/25902777975/artifacts/7011056595

Applied the formatting patch from the artifact and pushed it in commit 43dadf9d.

Copilot finished work on behalf of jkotas May 15, 2026 06:46
Copilot AI requested a review from jkotas May 15, 2026 06:46
Copilot AI review requested due to automatic review settings May 15, 2026 22:41
Copy link
Copy Markdown
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 10 out of 10 changed files in this pull request and generated no new comments.

@EgorBo
Copy link
Copy Markdown
Member

EgorBo commented May 16, 2026

/ba-g timeout

@EgorBo EgorBo enabled auto-merge (squash) May 16, 2026 16:14
@EgorBo EgorBo merged commit 5262eca into main May 16, 2026
121 of 126 checks passed
@EgorBo EgorBo deleted the copilot/delete-unused-helper-functions branch May 16, 2026 16:14
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.

4 participants