Skip to content
New issue

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

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

Already on GitHub? # to your account

JIT: revise checking for computed preds #81582

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

AndyAyersMS
Copy link
Member

Since pred lists now exist pervasively, change most methods that had conditional pred list updates to assert preds exist and always update.

To make sure I got all uses, I renamed fgComputePredsDone to fgPredsComputed.

Remove the ability to drop EH, as it doesn't update pred lists properly and so has been broken for quite a while now.

Remove some of the logic for fixing up finally targets, since we now always have pred lists around and so don't need the blanket invaliation.

Closes #80193.

Since pred lists now exist pervasively, change most methods that had
conditional pred list updates to assert preds exist and always update.

To make sure I got all uses, I renamed `fgComputePredsDone` to
`fgPredsComputed`.

Remove the ability to drop EH, as it doesn't update pred lists properly
and so has been broken for quite a while now.

Remove some of the logic for fixing up finally targets, since we now
always have pred lists around and so don't need the blanket invaliation.

Closes dotnet#80193.
@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 Feb 3, 2023
@ghost ghost assigned AndyAyersMS Feb 3, 2023
@ghost
Copy link

ghost commented Feb 3, 2023

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

Issue Details

Since pred lists now exist pervasively, change most methods that had conditional pred list updates to assert preds exist and always update.

To make sure I got all uses, I renamed fgComputePredsDone to fgPredsComputed.

Remove the ability to drop EH, as it doesn't update pred lists properly and so has been broken for quite a while now.

Remove some of the logic for fixing up finally targets, since we now always have pred lists around and so don't need the blanket invaliation.

Closes #80193.

Author: AndyAyersMS
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@AndyAyersMS
Copy link
Member Author

@EgorBo PTAL
cc @dotnet/jit-contrib

This is the final bit of revision for pred lists. I may still try and encapsulate the remove/add ref patterns that are now fairly pervasive but will likely instead start building upon the new capabilities that persistent pred lists offer.

@@ -4512,7 +4508,7 @@ class Compiler
#endif // FEATURE_JIT_METHOD_PERF

bool fgModified; // True if the flow graph has been modified recently
bool fgComputePredsDone; // Have we computed the bbPreds list
bool fgPredsComputed; // Have we computed the bbPreds list
Copy link
Member

Choose a reason for hiding this comment

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

Can you educate me why we need this at all? I assume it's false only during importing?

Copy link
Member Author

Choose a reason for hiding this comment

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

We actually build pred lists before importation, so fgPredsComputed is true for all phases. So it seems like something we don't need. But I kept this concept around for two reasons:

  • we sometimes do a bit of flow graph modification very early before we have added preds lists, and call methods that are also called after we have pred edges; those methods need to behave differently before and after (mainly fgEnsureFirstBBisScratch and friends
  • we want to make sure no other pred-list sensitive method is called early.

@AndyAyersMS
Copy link
Member Author

Failure is known issue.

@AndyAyersMS AndyAyersMS merged commit 73f1573 into dotnet:main Feb 3, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Mar 5, 2023
# for free to subscribe to this conversation on GitHub. Already have an account? #.
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.

JIT: build pred lists early, persist them throughout compilation
2 participants