Skip to content

Commit

Permalink
Correct miscounting due to in-place modification during lifting
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Atol committed Mar 14, 2022
1 parent fc2774f commit 4a2f668
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions base/compiler/ssair/passes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,9 @@ function lift_arg!(
end
if isa(lifted, GlobalRef) || isa(lifted, Expr)
lifted = insert_node!(compact, leaf, effect_free(NewInstruction(lifted, argextype(lifted, compact))))
compact[leaf] = nothing
stmt.args[argidx] = lifted
compact[leaf] = stmt
if isa(leaf, SSAValue) && leaf.id < compact.result_idx
push!(compact.late_fixup, leaf.id)
end
Expand Down Expand Up @@ -781,6 +783,7 @@ function sroa_pass!(ir::IRCode)
continue
end
if !isempty(new_preserves)
compact[idx] = nothing
compact[idx] = form_new_preserves(stmt, preserved, new_preserves)
end
continue
Expand Down

0 comments on commit 4a2f668

Please sign in to comment.