-
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: Use successor edges instead of block targets for BBJ_EHFINALLYRET #98563
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsPart of #93020. This is a first step in a broader effort to replace
|
Diff results for #98563Throughput diffsThroughput diffs for linux/arm64 ran on windows/x64Overall (+0.02% to +0.03%)
MinOpts (+0.02% to +0.06%)
FullOpts (+0.02% to +0.03%)
Throughput diffs for linux/x64 ran on windows/x64Overall (+0.03% to +0.04%)
MinOpts (+0.02% to +0.09%)
FullOpts (+0.03% to +0.04%)
Throughput diffs for osx/arm64 ran on windows/x64Overall (+0.02% to +0.03%)
MinOpts (+0.02% to +0.07%)
FullOpts (+0.02% to +0.03%)
Throughput diffs for windows/arm64 ran on windows/x64Overall (+0.02% to +0.03%)
MinOpts (+0.02% to +0.08%)
FullOpts (+0.02% to +0.03%)
Throughput diffs for windows/x64 ran on windows/x64Overall (+0.03% to +0.04%)
MinOpts (+0.02% to +0.09%)
FullOpts (+0.03% to +0.04%)
Details here Throughput diffs for windows/x86 ran on linux/x86Overall (+0.02% to +0.03%)
MinOpts (+0.02% to +0.09%)
FullOpts (+0.02% to +0.03%)
Details here |
cc @dotnet/jit-contrib, @AndyAyersMS PTAL. No diffs, though there is some TP impact -- CI failure is #98500. |
Diff results for #98563Throughput diffsThroughput diffs for linux/arm ran on windows/x86Overall (+0.02% to +0.03%)
MinOpts (+0.02% to +0.06%)
FullOpts (+0.02% to +0.03%)
Details here Throughput diffs for linux/arm64 ran on linux/x64MinOpts (+0.00% to +0.01%)
Throughput diffs for linux/x64 ran on linux/x64MinOpts (+0.00% to +0.01%)
Details here |
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 think this is the right direction to go in. Will be interesting to see what complications ensue when you get to more "popular" block kinds.
bool found = false; | ||
|
||
// Walk the successor table looking for the specified successor block. | ||
// Search succTab for succEdge so we can splice it out of the table. |
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.
Do you know how frequently we remove a successor like this?
If it happens somewhat frequently, I wonder if we'd be better off allowing there to be voids in the array and just skipping over them.
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'm not sure how often we encounter this, though I imagine this bit of logic isn't cheap TP-wise. There are quite a few places where we, for example, convert a BBJ_ALWAYS
to a BBJ_COND
(and vice versa), and we have to remove the current successor edge(s) from the successor block's pred list (and then add in new edges to the pred list -- it would be nice to see just how much #93636 helps with this). I can take a look at this locally and see how helpful it would be to skip this maintenance.
// | ||
BasicBlock* succBlock = edge->getDestinationBlock(); | ||
assert(succBlock != nullptr); | ||
succBlock->ensurePredListOrder(this); |
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.
Speaking of pred list order, we might want to revisit #93636 sometime.
CI failure is #98500. |
Part of #93020. This is a first step in a broader effort to replace
BasicBlock
's jump targets (bbTarget
,bbFalseTarget
, etc.) with successor flow edges. This PR also adds overloaded implementations for commonly used edge maintenance methods (fgReplacePred
,fgRemoveRefPred
, etc.) that can take advantage of the cheap access to successor edges (i.e. without callingfgGetPredForBlock
-- hopefully we'll be able to get rid of that at some point).