Skip to content

JIT: fix ACD EH region removal updates for filters #115054

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

Merged
merged 2 commits into from
Apr 25, 2025

Conversation

AndyAyersMS
Copy link
Member

@AndyAyersMS AndyAyersMS commented Apr 25, 2025

A filter ACD may change region number because some other EH region was deleted. Handle this properly.

Fixes #114895 #114985

A filter ACD may change region number because some other EH region was
deleted. Handle this properly.

Fixes dotnet#114895
@Copilot Copilot AI review requested due to automatic review settings April 25, 2025 16:45
@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Apr 25, 2025
@AndyAyersMS
Copy link
Member Author

@EgorBo PTAL
cc @dotnet/jit-contrib

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 fixes an issue with filter ACDs during EH region removal, ensuring they are handled properly when EH regions are deleted. Key changes include:

  • Adding a new regression test (Runtime_114324.cs) to trigger the ACD filter update.
  • Inserting additional JIT logging messages in jiteh.cpp and fgehopt.cpp to trace EH removals and ACD updates.
  • Updating flowgraph.cpp to assert and correctly adjust the key designator for filter and handler ACD entries.

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

File Description
src/tests/JIT/Regression/JitBlue/Runtime_114895/Runtime_114324.cs New regression test to verify EH region removal handling for filters.
src/coreclr/jit/jiteh.cpp Added logging for EH removal and ACD update tracking.
src/coreclr/jit/flowgraph.cpp Updated key designator handling with new asserts and conditional logic.
src/coreclr/jit/fgehopt.cpp Added logging before and after ACD updates during EH table entry removal.
Files not reviewed (1)
  • src/tests/JIT/Regression/JitBlue/Runtime_114895/Runtime_114324.csproj: Language not supported

{
System.Console.WriteLine(vr11);
}
catch (System.Exception)when (s_31[0])
Copy link
Preview

Copilot AI Apr 25, 2025

Choose a reason for hiding this comment

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

The static array 's_31' is declared but never initialized, which may lead to a NullReferenceException when accessing s_31[0]. Consider initializing 's_31' before it is used in the filter.

Copilot uses AI. Check for mistakes.

@@ -3909,26 +3911,35 @@ bool Compiler::AddCodeDsc::UpdateKeyDesignator(Compiler* compiler)
{
// Non-funclet case
//
assert(acdKeyDsg != AcdKeyDesignator::KD_FLT);
Copy link
Preview

Copilot AI Apr 25, 2025

Choose a reason for hiding this comment

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

The assert ensures that non-filter cases do not inadvertently retain a filter key designator. Consider adding a brief inline comment to clarify the invariant and reasoning behind the assert for future maintainers.

Copilot uses AI. Check for mistakes.

Copy link
Contributor

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

Copy link
Member

@EgorBo EgorBo left a comment

Choose a reason for hiding this comment

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

Seems like the test's Runtime_114895/Runtime_114324.cs file has a wrong issue id in its name

@AndyAyersMS
Copy link
Member Author

AndyAyersMS commented Apr 25, 2025

SPMI shows diffs but this makes no sense, clearly the inlining is different.

Looks like jitrollingbuild pipeline has lost permissions to upload new jits.

@AndyAyersMS AndyAyersMS merged commit a1435f1 into dotnet:main Apr 25, 2025
112 of 114 checks passed
@BruceForstall
Copy link
Contributor

You actually mean:

Fixes #114985

@AndyAyersMS
Copy link
Member Author

You actually mean:

Fixes #114985

Yes.

jakobbotsch pushed a commit to jakobbotsch/Fuzzlyn that referenced this pull request Apr 28, 2025
@github-actions github-actions bot locked and limited conversation to collaborators May 27, 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.

3 participants