Skip to content

Commit

Permalink
fix EA regression
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Oct 15, 2024
1 parent 9c53d9b commit d17aab3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion base/compiler/ssair/EscapeAnalysis/EscapeAnalysis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,10 @@ function escape_invoke!(astate::AnalysisState, pc::Int, args::Vector{Any})
# escape its arguments. However, since the arguments might be returned, we need
# to consider the possibility of aliasing between them and the return value.
for argidx = first_idx:last_idx
add_alias_change!(astate, ret, args[argidx])
arg = args[argidx]
if !is_mutation_free_argtype(argextype(arg, astate.ir))
add_alias_change!(astate, ret, arg)
end
end
return nothing
else
Expand Down
2 changes: 1 addition & 1 deletion test/compiler/effects.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ end

# These need EA
@test Core.Compiler.is_effect_free(Base.infer_effects(set_ref_with_unused_arg_1, (Base.RefValue{Int},)))
@test_broken Core.Compiler.is_effect_free(Base.infer_effects(set_ref_with_unused_arg_2, (Base.RefValue{Int},)))
@test Core.Compiler.is_effect_free(Base.infer_effects(set_ref_with_unused_arg_2, (Base.RefValue{Int},)))
@test Core.Compiler.is_effect_free_if_inaccessiblememonly(Base.infer_effects(set_arg_ref!, (Base.RefValue{Int},)))
@test_broken Core.Compiler.is_effect_free(Base.infer_effects(set_arr_with_unused_arg_1, (Vector{Int},)))
@test_broken Core.Compiler.is_effect_free(Base.infer_effects(set_arr_with_unused_arg_2, (Vector{Int},)))
Expand Down

0 comments on commit d17aab3

Please sign in to comment.