-
Notifications
You must be signed in to change notification settings - Fork 5.1k
JIT: Unify block successor iteration logic #117743
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: Unify block successor iteration logic #117743
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
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.
Pull Request Overview
This PR consolidates the successor‐iteration APIs by collapsing the two non‐templated lists into a single BBSuccList<IteratorType>
, removes the old BasicBlock::NumSucc(Compiler*)
/GetSucc(Compiler*)
overloads, and updates all call sites accordingly. It also removes bbFallsThrough
and its uses.
- Introduces a templated
BBSuccList<IteratorType>
inblock.h
/block.cpp
- Deletes
Succs(this)
/SuccEdges(this)
and replaces them withSuccs()
/SuccEdges()
- Removes
BasicBlock::NumSucc(Compiler*)
, updates call sites toNumSucc()
andGetSucc()
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/coreclr/jit/promotion.cpp | Updated dspBlockHeader calls to drop the Compiler* |
src/coreclr/jit/lsrabuild.cpp | Replaced NumSucc(compiler) with NumSucc() |
src/coreclr/jit/lsra.cpp | Swapped NumSucc(compiler) , Succs(compiler) to new APIs |
src/coreclr/jit/importer.cpp | Replaced Succs(this) with Succs() |
src/coreclr/jit/flowgraph.cpp | Removed bbFallsThrough assertion |
src/coreclr/jit/fgprofilesynthesis.cpp | Updated SuccEdges(m_comp) and NumSucc() calls |
src/coreclr/jit/fgprofile.cpp | Swapped NumSucc(this) , GetSucc(i,this) , SuccEdges |
src/coreclr/jit/fgopt.cpp | Replaced Succs(this) iterations |
src/coreclr/jit/fgdiagnostic.cpp | Updated dspSuccs and Succs(this) calls |
src/coreclr/jit/fgbasic.cpp | Swapped Succs(this) uses |
src/coreclr/jit/compiler.cpp | Updated debug comment and dspSuccs call |
src/coreclr/jit/codegenlinear.cpp | Adjusted dspBlockHeader usage |
src/coreclr/jit/block.h | Added templated BBSuccList , removed old overloads |
src/coreclr/jit/block.cpp | Implemented BBSuccList constructor, removed old code |
Comments suppressed due to low confidence (1)
src/coreclr/jit/block.h:1929
- [nitpick] Consider marking
SuccEdges()
as aconst
method to matchSuccs()
(which isconst
) and allow iterating edges onconst BasicBlock
instances.
BBSuccList<FlowEdgeArrayIterator> SuccEdges()
@dotnet/jit-contrib PTAL. No diffs. Thanks! |
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.
Nice to see this get cleaned up.
/ba-g build timeouts |
Follow-up to #117423.
BBSuccList
andBBSuccEdgeList
into one templatized type, where the template specifies the iterator kindBasicBlock::NumSucc(Compiler*)
et alBasicBlock::NumSucc()
et al deal only with unique successors, now that they're always availableBasicBlock::bbFallsThrough