Repository navigation
Improve reachability sets computation - #84204
Merged
BruceForstall merged 2 commits intoApr 1, 2023
Merged
Conversation
Two changes to improve the throughput of computing `bbReach` sets: 1. In `fgComputeReachabilitySets()`, iterate over the blocks in reverse post-order. This leads to fewer outer `do ... while(change)` iterations. To do this, the `fgDfsReversePostorder()` function which creates the reverse post-order numbers and ordering was hoisted out of dominator creation and above reachability computation. 2. Create a `BlockSetOps::UnionDChanged()` function that does a `UnionD` operation but also returns `true` if the target bitset changed value. Some additional stats were added under `COUNT_BASIC_BLOCKS` regarding how many iterations dominators and reachability computations take to converge.
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch, @kunalspathak Issue DetailsTwo changes to improve the throughput of computing
Some additional stats were added under
|
Contributor
Author
|
TP improvements up to -0.09% |
Contributor
Author
|
@AndyAyersMS PTAL |
AndyAyersMS
approved these changes
Apr 1, 2023
AndyAyersMS
left a comment
Member
There was a problem hiding this comment.
LGTM.
Surprised it didn't help more. Maybe the fussing about with BBF_GC_SAFE_POINT is inefficient?
Seems like that could be handled without branching, eg
predGcSafe &= (pred->bbFlags & BBF_GC_SAFE_POINT) != 0;| // Destructively modify "bs1" to be the union of "bs1" and "bs2". | ||
| static void UnionD(Env env, BitSetType& bs1, BitSetValueArgType bs2); | ||
| // Destructively modify "bs1" to be the union of "bs1" and "bs2"; return `true` if `bs1` changed. | ||
| static void UnionDChanged(Env env, BitSetType& bs1, BitSetValueArgType bs2); |
Member
There was a problem hiding this comment.
Suggested change
| static void UnionDChanged(Env env, BitSetType& bs1, BitSetValueArgType bs2); | |
| static bool UnionDChanged(Env env, BitSetType& bs1, BitSetValueArgType bs2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two changes to improve the throughput of computing
bbReachsets:fgComputeReachabilitySets(), iterate over the blocks in reverse post-order. This leads to fewer outerdo ... while(change)iterations. To do this, thefgDfsReversePostorder()function which creates the reverse post-order numbers and ordering was hoisted out of dominator creation and above reachability computation.BlockSetOps::UnionDChanged()function that does aUnionDoperation but also returnstrueif the target bitset changed value.Some additional stats were added under
COUNT_BASIC_BLOCKSregarding how many iterations dominators and reachability computations take to converge.