-
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: more likelihood checking #99541
Conversation
Check has likelihood and likelihood sum consistency all the way until rationalize. Several phases required a bit of revision, notably the multi-guess type test expansion (similar to GDV) and optimize bools. Fix carry-over issue from previous round where block and edge scaling in loop cloning used different factors. Contributes to dotnet#93020
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Arm failure:
This PR passed in draft form, so issue is likely unrelated. |
Seems like an instance of #86273, already known to build analysis. |
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'm excited to see how far along this is. I imagine flowgraph modifications after block layout aren't all that frequent?
FlowEdge* oldEdge = bSrc->GetFalseEdge(); | ||
jmpBlk = fgNewBBafter(BBJ_ALWAYS, bSrc, true); | ||
FlowEdge* const oldEdge = bSrc->GetFalseEdge(); | ||
// Access the likelihood of oldEdge before |
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.
Good catch, I probably should've paid more attention to the diffs this likelihood weirdness would've caused when I changed SetTargetEdge
to set the likelihood.
|
||
// review: we assume length check always succeeds?? | ||
trueEdge->setLikelihood(1.0); | ||
falseEdge->setLikelihood(0.0); |
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.
cc @dotnet/jit-contrib -- what do you think?
// Predecessor is the nullcheck, control reaches on false. | ||
// | ||
curTypeCheckBb->inheritWeight(nullcheckBb); | ||
curTypeCheckBb->scaleBBWeight(nullcheckBb->GetFalseEdge()->getLikelihood()); |
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.
Once edge likelihood propagation is done, we'll probably want to combine these two methods into one, right?
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.
I will probably add a float overload for inherit weight. I might try and redo the old GDV likelihoods so they're [0..1] instead of [0..100].
Not sure yet. There are some. Looking at lower's switch expansion now. |
Only a handful of diffs. |
Check has likelihood and likelihood sum consistency all the way until rationalize. Several phases required a bit of revision, notably the multi-guess type test expansion (similar to GDV) and optimize bools. Fix carry-over issue from previous round where block and edge scaling in loop cloning used different factors. Contributes to dotnet#93020
Check has likelihood and likelihood sum consistency all the way until rationalize.
Several phases required a bit of revision, notably the multi-guess type test expansion (similar to GDV) and optimize bools.
Fix carry-over issue from previous round where block and edge scaling in loop cloning used different factors.
Contributes to #93020
(Continuation of #99460)
Diffs