Skip to content

JIT: Size the global assertion table by the actual number of assertions - #136421

Merged
EgorBo merged 2 commits into
dotnet:mainfrom
EgorBo:jit-global-assertion-table-growth
Oct 26, 2026
Merged

EgorBo merged 2 commits into
dotnet:mainfrom
EgorBo:jit-global-assertion-table-growth

Conversation

@EgorBo

@EgorBo EgorBo commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Instead of sizing the global assertion table upfront via the max(64, min(256, (lvaTrackedCount + 3*fgBBcount + 48) >> 2)) heuristic, the table now starts at 64 entries and grows on demand during assertion generation (up to 512). Once generation is done, the bit vector traits are sized by the actual number of assertions.

Some nice diffs and TP improvement

Instead of sizing the global assertion table (and the bit vectors) upfront via
a heuristic, grow the table on demand during assertion gen (up to 512) and size
the bit vectors by the actual number of assertions afterwards. This avoids
dropping assertions in methods the heuristic underpredicted, and avoids larger
than needed bit vectors in methods it overpredicted.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e6dfca0e-42e2-45de-99de-222d54fe6937
@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 Oct 24, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
11 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.

Assertions against integer constants can only constrain their left-hand VN. Reject unrelated ones before evaluating the remaining range-analysis cases.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e6dfca0e-42e2-45de-99de-222d54fe6937
@EgorBo
EgorBo marked this pull request as ready for review October 26, 2026 10:42
Comment thread src/coreclr/jit/rangecheck.cpp
@EgorBo

EgorBo commented Oct 26, 2026

Copy link
Copy Markdown
Member Author

PTAL @dotnet/jit-contrib size/TP improvement. It is needed for extra assertions I wanted to fit there.

@EgorBo
EgorBo requested a review from a team October 26, 2026 10:44
@EgorBo
EgorBo merged commit d98bd20 into dotnet:main Oct 26, 2026
129 of 131 checks passed
@EgorBo
EgorBo deleted the jit-global-assertion-table-growth branch October 26, 2026 20:27
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 27, 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.

2 participants