Skip to content

Revert "Increase number of assertions (GlobalAP) + VN cache (#124132)"#124928

Merged
AndyAyersMS merged 1 commit intodotnet:mainfrom
AndyAyersMS:Revert124132
Feb 27, 2026
Merged

Revert "Increase number of assertions (GlobalAP) + VN cache (#124132)"#124928
AndyAyersMS merged 1 commit intodotnet:mainfrom
AndyAyersMS:Revert124132

Conversation

@AndyAyersMS
Copy link
Member

This reverts commit 92741be.

This was causing excessive memory allocation during jitting (see dotnet/dotnet#4933).

Copilot AI review requested due to automatic review settings February 26, 2026 22:43
@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 26, 2026
@AndyAyersMS
Copy link
Member Author

@EgorBo PTAL
FYI @dotnet/jit-contrib @janvorli

@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 reverts commit 92741be which introduced VN (Value Number) caching and a more sophisticated assertion count heuristic for the JIT's global assertion propagation optimization. The revert is necessary because the original changes caused excessive memory allocation during jitting.

Changes:

  • Restored the original simpler IL-size-based assertion count heuristic (using a lookup table based on IL code size)
  • Removed the VN-based caching mechanism (optAssertionVNsMap) and related helper method (optAssertionHasAssertionsForVN)
  • Reverted early-exit optimizations that relied on the VN cache

Reviewed changes

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

File Description
src/coreclr/jit/rangecheck.cpp Reverted VN cache check back to simple NoVN check in MergeEdgeAssertions
src/coreclr/jit/compiler.h Removed optAssertionVNsMap field and optAssertionHasAssertionsForVN method declaration
src/coreclr/jit/assertionprop.cpp Restored original assertion count heuristic, removed VN caching logic in optAddAssertion, removed optAssertionHasAssertionsForVN implementation, and removed VN-based early-exit optimizations

@AndyAyersMS AndyAyersMS requested a review from EgorBo February 26, 2026 23:03
Copy link
Contributor

@adamperlin adamperlin left a comment

Choose a reason for hiding this comment

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

I don't have the context to say what exactly is causing the issue here, but I'm signing off to unblock as this fix was confirmed to resolve the memory usage issue.

@AndyAyersMS
Copy link
Member Author

/ba-g build analysis stuck

@AndyAyersMS AndyAyersMS merged commit 71ffd70 into dotnet:main Feb 27, 2026
132 of 134 checks passed
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