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

JIT: Validate DFS tree in post-phase checks #95652

Closed
jakobbotsch opened this issue Dec 5, 2023 · 1 comment · Fixed by #95682
Closed

JIT: Validate DFS tree in post-phase checks #95652

jakobbotsch opened this issue Dec 5, 2023 · 1 comment · Fixed by #95682
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone

Comments

@jakobbotsch
Copy link
Member

Recomputing the DFS will cause m_dfs and m_loops to return nonsensical results (i.e. the results aren't just outdated). We should validate in post-phase checks that the DFS tree we're storing matches the flow graph, and explicitly null out the relevant information when we invalidate it.

@jakobbotsch jakobbotsch added this to the 9.0.0 milestone Dec 5, 2023
@jakobbotsch jakobbotsch self-assigned this Dec 5, 2023
@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 Dec 5, 2023
@ghost
Copy link

ghost commented Dec 5, 2023

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

Issue Details

Recomputing the DFS will cause m_dfs and m_loops to return nonsensical results (i.e. the results aren't just outdated). We should validate in post-phase checks that the DFS tree we're storing matches the flow graph, and explicitly null out the relevant information when we invalidate it.

Author: jakobbotsch
Assignees: jakobbotsch
Labels:

area-CodeGen-coreclr

Milestone: 9.0.0

jakobbotsch added a commit to jakobbotsch/runtime that referenced this issue Dec 6, 2023
Add a post-phase check that validates that the DFS tree matches the
current flow graph when it is non-null.

Add a `fgInvalidateDfsTree()` that invalidates the DFS tree and derived
annotations on it (dominators and loops). We invalidate after RBO, which
is the last point we expect to make use of the flow graph information.

Compute new DFS and loops as part of loop unrolling to make the DFS tree
correct after this point too. Some TP regressions are expected due to
this.

To sum up we now keep this information valid from loop finding until
RBO.

Fix dotnet#95652
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Dec 6, 2023
jakobbotsch added a commit that referenced this issue Dec 8, 2023
Add a post-phase check that validates that the DFS tree matches the
current flow graph when it is non-null.

Add a `fgInvalidateDfsTree()` that invalidates the DFS tree and derived
annotations on it (dominators and loops). We invalidate after RBO, which
is the last point we expect to make use of the flow graph information.

Fix #95652
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Dec 8, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 8, 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 a pull request may close this issue.

1 participant