-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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: Reuse (new) loop-finding DFS tree in SSA #95809
Conversation
* Add a new phase to canonicalize the entry BB, way back before we compute reachability * Switch SSA to reuse the DFS computed for (new) loop finding * Switch SSA to use post-order traits instead of bbNum-based traits
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue Details
|
cc @dotnet/jit-contrib PTAL @AndyAyersMS @BruceForstall Diffs. ASM diffs from the RBO case mentioned above. TP improvements from doing one less DFS. |
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.
LGTM.
I wonder if we could simplify things by just always creating a "scratch" first BB when the flow graph is created, and then teaching flow opts (e.g., block compaction) to not remove it even if empty. Then we could get rid of fgEnsureFirstBBisScratch and this new phase. Codegen wouldn't generate any code if the block ends up empty.
Yeah, I think that kind of canonicalization would be good. It would also benefit us earlier by allowing us to use the DFS I added in #95726 in e.g. physical promotion. Currently physical promotion may need to create a scratch BB and would thus invalidate the DFS tree. |
Some improvements are expected from RBO no longer getting caught up in this early-out:
runtime/src/coreclr/jit/redundantbranchopts.cpp
Lines 766 to 770 in 9080024