Remove unnecessary _featureCheckValues cache from ILLink#127302
Open
sbomer wants to merge 1 commit intodotnet:mainfrom
Open
Remove unnecessary _featureCheckValues cache from ILLink#127302sbomer wants to merge 1 commit intodotnet:mainfrom
sbomer wants to merge 1 commit intodotnet:mainfrom
Conversation
Now that CodeRewriterStep runs before SweepStep (changed in dotnet#127090), the FeatureSwitchDefinition and FeatureGuard attributes are still present when CodeRewriterStep needs them. The _featureCheckValues cache in MemberActionStore and the eager pre-computation in MarkStep were added in dotnet#104995 to work around the old ordering where attributes could be swept before CodeRewriterStep ran. They are no longer needed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Assisted-by: Claude:claude-opus-4.6-1m
Contributor
|
Tagging subscribers to this area: @agocke, @dotnet/illink |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes now-unnecessary feature-check caching logic in the ILLinker, relying on the updated pipeline ordering where CodeRewriterStep runs before SweepStep so feature attributes remain available when stubbing decisions are made.
Changes:
- Remove the
_featureCheckValuescache fromMemberActionStoreand evaluate feature-check values directly from attributes/settings when needed. - Remove
MarkStep’s eager precomputation of stub values forConvertToStubmethods, since attribute sweeping no longer precedes rewriting.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/tools/illink/src/linker/Linker/MemberActionStore.cs | Deletes the feature-check memoization and associated System.Diagnostics using; computes feature-check results on demand. |
| src/tools/illink/src/linker/Linker.Steps/MarkStep.cs | Removes precomputation of stub values for ConvertToStub methods, aligning behavior with the reordered step pipeline. |
This was referenced Apr 23, 2026
Open
This was referenced Apr 23, 2026
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.
Now that CodeRewriterStep runs before SweepStep (#127090), the
_featureCheckValuescache inMemberActionStoreand the eager pre-computation inMarkStepare no longer needed.The cache was added in #104995 to preserve feature attribute values before they could be swept away. With the step reordering, attributes are still present when
CodeRewriterStepprocesses them.This cleanup was suggested in #127090 (comment)