-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Improve reachability sets computation #84204
Improve reachability sets computation #84204
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
|
TP improvements up to -0.09% |
@AndyAyersMS PTAL |
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.
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;
src/coreclr/jit/bitset.h
Outdated
@@ -228,6 +228,8 @@ class BitSetOps | |||
|
|||
// 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); |
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.
static void UnionDChanged(Env env, BitSetType& bs1, BitSetValueArgType bs2); | |
static bool UnionDChanged(Env env, BitSetType& bs1, BitSetValueArgType bs2); |
Two changes to improve the throughput of computing
bbReach
sets: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 aUnionD
operation but also returnstrue
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.