-
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 remaining block kinds #98993
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsPart of #93020. Replaces
|
/azp run runtime-coreclr outerloop, runtime-coreclr jitstress, runtime-coreclr libraries-jitstress, Fuzzlyn |
Azure Pipelines successfully started running 4 pipeline(s). |
/azp run runtime-coreclr outerloop, runtime-coreclr jitstress, runtime-coreclr libraries-jitstress, Fuzzlyn |
Azure Pipelines successfully started running 4 pipeline(s). |
cc @dotnet/jit-contrib, @AndyAyersMS PTAL. Sorry for the large change; here are a few notes that will hopefully expedite reviews:
JitStress failure is #98971. SPMI failure is a timeout. |
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.
This was pleasantly mechanical to review. Nice work!
My recent on likelihood checking PR will clash. Yours should go first.
@@ -194,7 +194,7 @@ inline AssertionIndex GetAssertionIndex(unsigned index) | |||
|
|||
class AssertionInfo | |||
{ | |||
// true if the assertion holds on the bbNext edge instead of the bbTarget edge (for GT_JTRUE nodes) | |||
// true if the assertion holds on the false edge instead of the true edge (for GT_JTRUE nodes) |
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.
We should consider renaming the field too, the logical name would be m_isFalseEdgeAssertion
but that might mix up whether it's an assertion about the false edge, or a false assertion about an edge. So maybe m_assertionHoldsOnFalseEdge
?
But I suggest deferring this until later.
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 have some cleanup tasks planned as a follow-up to this PR. I'll make sure to include the rename; m_assertionHoldsOnFalseEdge
sounds good to me.
fgRemoveRefPred(currentBlock->GetTargetEdge()); | ||
FlowEdge* const newEdge = fgAddRefPred(postTryFinallyBlock, currentBlock); | ||
|
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 can already see that this removeRef/addRef/setTarget pattern is super common. Looking forward to us encapsulating this sort of thing in a future PR.
Thanks for letting me know -- I'll merge this now. |
After #98993, the logic for initializing edge likelihoods in fgAddRefPred can potentially read uninitialized memory by calling BasicBlock::NumSucc. Avoid this by moving the edge likelihood logic to fgLinkBasicBlocks, where we can safely and cheaply determine the number of successors. Also, rename AssertionInfo::m_isNextEdgeAssertion based on feedback from #98993.
Part of #93020. Replaces
BasicBlock::bbTarget/bbFalseTarget/bbTrueTarget
withFlowEdge*
members.