Skip to content

JIT: Raise CSE candidate limit - #138310

Open
NinoFloris wants to merge 2 commits into
dotnet:mainfrom
NinoFloris:jit/cse-candidate-limit
Open

NinoFloris wants to merge 2 commits into
dotnet:mainfrom
NinoFloris:jit/cse-candidate-limit

Conversation

@NinoFloris

Copy link
Copy Markdown
Contributor

The old limit of 64 came from the previous bit-vector representation. The remaining limit is gtCSEnum, which uses a signed byte to encode candidate indices and can represent indices up to 127

The 64 limit came from the retired uint64 EXPSET_TP representation, and the remaining encoding bound is gtCSEnum's signed char, which holds indexes to 127 with the def negation. The availability sets are dynamic bit vectors sized by the candidate count, so methods below the old limit are unaffected.

In large methods the promoted temps are mostly regional rather than simultaneously live, measured at 9 concurrent of 43 promoted in one capped method, so additional candidates do not compete for the same registers. On top of deferred re-ranking the extra indexes net another six-figure PerfScore win on the win-x64 run_pgo monsters with a loss tail of tens of PerfScore, and a small net win across the osx-arm64 collection.
Increment CseDeniedCount each time a tracked expression repeats but cannot get a slot because MAX_CSE_CNT has been reached. Include the key, cost and block weight in JitDump for both denied and untracked occurrences.
@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 Nov 25, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Nov 25, 2026
@azure-pipelines

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

@NinoFloris NinoFloris changed the title Jit: Raise CSE candidate limit JIT: Raise CSE candidate limit Nov 25, 2026
@NinoFloris

Copy link
Copy Markdown
Contributor Author

@AndyAyersMS it's not the most spectacular TP trade, but it's not terrible. PTAL https://dev.azure.com/dnceng-public/public/_build/results?buildId=1699948&view=ms.vss-build-web.run-extensions-tab

@NinoFloris
NinoFloris marked this pull request as ready for review November 25, 2026 22:36

This branch has not been deployed

No deployments
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 community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant