JIT: Use successor edges instead of block targets for remaining block kinds#98993
JIT: Use successor edges instead of block targets for remaining block kinds#98993amanasifkhalid merged 18 commits intodotnet:mainfrom
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. |
AndyAyersMS
left a comment
There was a problem hiding this comment.
This was pleasantly mechanical to review. Nice work!
My recent on likelihood checking PR will clash. Yours should go first.
| 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.
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.
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.
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/bbTrueTargetwithFlowEdge*members.