Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jakobbotsch
Copy link
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 Copilot AI review requested due to automatic review settings May 1, 2025 10:43
@dotnet-issue-labeler dotnet-issue-labeler bot 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
Contributor

@Copilot 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.

Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@jakobbotsch
Copy link
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
// If we ran out of budget we could have already cached the
// result in the leaf. In that case it is ok to overwrite
// it here.
GetMapSelectWorkCache()->Set(fstruct, entry, MapSelectWorkCache::Overwrite);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth validating in debug that the cache has this result already?

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.

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