Skip to content

JIT: Overwrite cache during recursive map select in VN#115219

Merged
jakobbotsch merged 2 commits intodotnet:mainfrom
jakobbotsch:fix-108850
May 14, 2025
Merged

JIT: Overwrite cache during recursive map select in VN#115219
jakobbotsch merged 2 commits intodotnet:mainfrom
jakobbotsch:fix-108850

Conversation

@jakobbotsch
Copy link
Copy Markdown
Member

If the recursive select runs out of budget it may have already cached a value. In that case allow overwriting the cached value (which should just replace it with the same value).

This handles a similar case that the other case already handles:

// We may have run out of budget and already assigned a result
if (!GetMapSelectWorkCache()->Lookup(fstruct, &entry))

Fix #108850

If the recursive select runs out of budget it may have already cached a
value. In that case allow overwriting the cached value (which should
just replace it with the same value).
Copilot AI review requested due to automatic review settings May 1, 2025 10:43
@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label May 1, 2025
Copy link
Copy Markdown
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 updates the recursive map select routine in the JIT to allow overwriting a previously cached value when running out of budget. The change mirrors similar behavior in a related case in the runtime code.

  • Changed the caching call to use the Overwrite flag in GetMapSelectWorkCache()->Set.
  • Added inline comments explaining the rationale for allowing overwrites.

Comment thread src/coreclr/jit/valuenum.cpp
@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.

@jakobbotsch
Copy link
Copy Markdown
Member Author

jakobbotsch commented May 1, 2025

PTAL @dotnet/jit-contrib

No diffs

@jakobbotsch jakobbotsch requested a review from a team May 1, 2025 14:21
Comment thread src/coreclr/jit/valuenum.cpp Outdated
@jakobbotsch jakobbotsch merged commit f76d757 into dotnet:main May 14, 2025
109 of 110 checks passed
@jakobbotsch jakobbotsch deleted the fix-108850 branch May 14, 2025 07:38
@github-actions github-actions bot locked and limited conversation to collaborators Jun 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

Assertion failed 'kind == Overwrite' during 'VN-based dead store removal'

3 participants