Rework and simplify initial versioning and tiering rules#125243
Merged
davidwrighton merged 6 commits intodotnet:mainfrom Mar 10, 2026
Merged
Conversation
Member
davidwrighton
commented
Mar 5, 2026
- Remove CallCountingInfo::Disabled stage and associated methods (DisableCallCounting, IsCallCountingEnabled, CreateWithCallCountingDisabled)
- Move initial optimization tier determination from per-method JIT-time logic to a config-time decision (TieredCompilation_DefaultTier) computed once during EEConfig::sync()
- Store the default code version's optimization tier directly on MethodDescCodeData, replacing the indirect approach of disabling call counting to signal optimized tier
- Remove WasTieringDisabledBeforeJitting flag from PrepareCodeConfig and MethodDescVersioningState
- Simplify GetJitFlags by removing the special default-version fast path and using the unified optimization tier switch for all code versions
- Add OptimizationTierUnknown sentinel to distinguish uninitialized state
- Simplify FinalizeOptimizationTierForTier0Load to handle R2R loading based on the stored optimization tier
- Remove CallCountingInfo::Disabled stage and associated methods (DisableCallCounting, IsCallCountingEnabled, CreateWithCallCountingDisabled) - Move initial optimization tier determination from per-method JIT-time logic to a config-time decision (TieredCompilation_DefaultTier) computed once during EEConfig::sync() - Store the default code version's optimization tier directly on MethodDescCodeData, replacing the indirect approach of disabling call counting to signal optimized tier - Remove WasTieringDisabledBeforeJitting flag from PrepareCodeConfig and MethodDescVersioningState - Simplify GetJitFlags by removing the special default-version fast path and using the unified optimization tier switch for all code versions - Add OptimizationTierUnknown sentinel to distinguish uninitialized state - Simplify FinalizeOptimizationTierForTier0Load to handle R2R loading based on the stored optimization tier Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Tagging subscribers to this area: @agocke |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors CoreCLR tiered compilation’s initial tier selection and tiering signaling by moving “default tier” decisions into EEConfig::sync(), removing the call-counting “disabled” signaling path, and storing the default version tier on MethodDesc code data.
Changes:
- Compute and expose a single
TieredCompilation_DefaultTiervalue inEEConfig, and use it for initial tier selection. - Add
OptimizationTierUnknownand a per-MethodDescstored optimization tier, and route default-version tier reads/writes through it. - Remove the call-counting “Disabled” stage and related APIs/flags, simplifying tier-related logic in the JIT flag path and prestub tier finalization.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/vm/tieredcompilation.cpp | Switch initial tier selection to use EEConfig’s computed default tier. |
| src/coreclr/vm/prestub.cpp | Remove “disable call counting” signaling; revise tier finalization for R2R load based on stored tier. |
| src/coreclr/vm/method.hpp | Add stored optimization tier to MethodDescCodeData; remove WasTieringDisabledBeforeJitting plumbing. |
| src/coreclr/vm/method.cpp | Initialize and implement MethodDesc optimization tier storage helpers. |
| src/coreclr/vm/eeconfig.h | Add TieredCompilation_DefaultTier() accessor and config backing field. |
| src/coreclr/vm/eeconfig.cpp | Compute tieredCompilation_DefaultTier during EEConfig::sync(). |
| src/coreclr/vm/codeversion.h | Add OptimizationTierUnknown sentinel value. |
| src/coreclr/vm/codeversion.cpp | Use stored MethodDesc tier when available; set it for default versions via MethodDesc. |
| src/coreclr/vm/callcounting.h | Remove CallCountingInfo::Disabled stage and disabled-construction helpers. |
| src/coreclr/vm/callcounting.cpp | Remove disabled-stage construction/guards and remove disabled-callcounting APIs’ implementations. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
….com:davidwrighton/runtime into rework_and_simplify_initial_versioning_rules
- Remove redundant IsDefaultVersion() guard before IsFinalTier() check in CallCountingManager::SetCodeEntryPoint - Query optimization tier from CodeVersion instead of MethodDesc in FinalizeOptimizationTierForTier0Load - Clean up comment formatting in EEConfig::sync Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This was referenced Mar 10, 2026
davidwrighton
added a commit
to davidwrighton/runtime
that referenced
this pull request
Mar 12, 2026
…net#125243)" This reverts commit 535c5de. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.