Skip to content
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

[release/9.0-preview4] JIT: Avoid relying on bbNum to find lexical loop boundaries #101724

Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Apr 30, 2024

Backport of #101714 to release/9.0-preview4

/cc @jakobbotsch

Customer Impact

  • Customer reported
  • Found internally

The JIT may crash when compiling functions involving a particular code pattern with multiple intertwined loops. In these cases the JIT internally fails to find the correct first basic block corresponding to a loop, and unexpectedly runs out of basic blocks as a result. Reported in #101695 and blocks flow into ASP.NET.

Regression

  • Yes
  • No

Introduced in #96995 and exposed subsequently by #99827.

Testing

Manually verified that the ASP.NET test case no longer crashes.

Risk

Low. The fix makes the query to find the first basic block corresponding to a loop more robust.

Switch `FlowGraphNaturalLoop::GetLexicallyTopMostBlock` and
`FlowGraphNaturalLoop::GetLexicallyBottomMostBlock` to more robust
implementations that scan the basic block list forwards (and backwards)
to find the boundary blocks.

Fix #101695
@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 Apr 30, 2024
Copy link
Contributor

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

@jakobbotsch jakobbotsch requested a review from AndyAyersMS April 30, 2024 16:39
@JulieLeeMSFT
Copy link
Member

@jeffschwMSFT, please review and approve this backporting that fixes preview 4 build break.

@mmitche
Copy link
Member

mmitche commented Apr 30, 2024

Merging optimistically to unblock p4, @jeffschwMSFT please still take a look.

@mmitche mmitche merged commit 274daa1 into release/9.0-preview4 Apr 30, 2024
92 of 95 checks passed
@jakobbotsch jakobbotsch deleted the backport/pr-101714-to-release/9.0-preview4 branch May 1, 2024 21:24
@github-actions github-actions bot locked and limited conversation to collaborators Jun 1, 2024
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.

5 participants