Skip to content

Do not allocate so many arrays in optimizer hot path #44492

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

Merged
merged 1 commit into from
Mar 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions base/compiler/ssair/slot2ssa.jl
Original file line number Diff line number Diff line change
Expand Up @@ -551,13 +551,13 @@ function compute_live_ins(cfg::CFG, defs::Vector{Int}, uses::Vector{Int})
extra_liveins = BitSet()
worklist = Int[]
for bb in bb_uses
append!(worklist, filter(p->p != 0 && !(p in bb_defs), cfg.blocks[bb].preds))
append!(worklist, Iterators.filter(p->p != 0 && !(p in bb_defs), cfg.blocks[bb].preds))
end
while !isempty(worklist)
elem = pop!(worklist)
(elem in bb_uses || elem in extra_liveins) && continue
push!(extra_liveins, elem)
append!(worklist, filter(p->p != 0 && !(p in bb_defs), cfg.blocks[elem].preds))
append!(worklist, Iterators.filter(p->p != 0 && !(p in bb_defs), cfg.blocks[elem].preds))
end
append!(bb_uses, extra_liveins)
BlockLiveness(bb_defs, bb_uses)
Expand Down