-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
optimizer: refactor SROA pass #43232
Conversation
@@ -596,17 +596,16 @@ a result of succeeding dead code elimination. | |||
""" | |||
function sroa_pass!(ir::IRCode) | |||
compact = IncrementalCompact(ir) | |||
defuses = IdDict{Int, Tuple{IdSet{Int}, SSADefUse}}() | |||
defuses = nothing # will be initialized once we encounter mutability in order to reduce dynamic allocations |
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 just wonder: we may want to have some nice support for this sort of optimization?
Like: @delay_alloc defuses = IdDict{Int, Tuple{BitSet, SSADefUse}}()
cef9efa
to
f0e684a
Compare
|
Codecov Report
@@ Coverage Diff @@
## master #43232 +/- ##
==========================================
- Coverage 89.62% 89.52% -0.11%
==========================================
Files 343 343
Lines 80294 80301 +7
==========================================
- Hits 71961 71886 -75
- Misses 8333 8415 +82
Continue to review full report at Codecov.
|
f0e684a
to
b8af9c6
Compare
Aha, I see the point. SROA works on IR after inlining, which can be very large sometimes, and program counters analyzed by it are often very sparse. |
b8af9c6
to
b1da35a
Compare
- use `BitSet` instead of `IdSet{Int}` - reduce # of dynamic allocations - separate some computations into individual functions
b1da35a
to
6c4e203
Compare
- avoid domtree construction when there are no mutables to eliminate - reduce # of dynamic allocations - separate some computations into individual functions
- avoid domtree construction when there are no mutables to eliminate - reduce # of dynamic allocations - separate some computations into individual functions
BitSet
instead ofIdSet{Int}
TTFP improvements: