-
Notifications
You must be signed in to change notification settings - Fork 5.1k
JIT: Add a gtFindNodeInTree
helper
#115975
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
Conversation
Add a gtFindNodeInTree helper to find a node in a tree matching a predicate, and use it in a couple of places
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
PTAL @dotnet/jit-contrib. No diffs, just adding a helper and replacing a few places to use it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Introduces a generic gtFindNodeInTree
helper to replace several bespoke tree‐walking visitors for finding nodes by predicate.
- Adds the
gtFindNodeInTree
template incompiler.hpp
with flags-based subtree filtering. - Refactors existing
gtTreeContains*
and custom visitor usages to callgtFindNodeInTree
. - Eliminates duplicated visitor classes from
gschecks.cpp
,gentree.cpp
, andfgopt.cpp
.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
compiler.hpp | Added gtFindNodeInTree template declaration |
gschecks.cpp | Replaced custom GenTreeVisitor with gtFindNodeInTree |
gentree.cpp | Swapped out gtTreeContainsOper visitor for helper |
fgopt.cpp | Replaced gtTreeContainsCall patterns with helper |
compiler.h | Removed obsolete gtTreeContainsCall declaration, added helper declaration |
/ba-g Timeout is #115955 |
Add a gtFindNodeInTree helper to find a node in a tree matching a predicate, and use it in a couple of places