Skip to content

Commit

Permalink
Pass around effects during cacheing (#44777)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Atol authored Mar 28, 2022
1 parent 89a613b commit d7782de
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions base/compiler/typeinfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ function maybe_compress_codeinfo(interp::AbstractInterpreter, linfo::MethodInsta
end

function transform_result_for_cache(interp::AbstractInterpreter, linfo::MethodInstance,
valid_worlds::WorldRange, @nospecialize(inferred_result))
valid_worlds::WorldRange, @nospecialize(inferred_result),
ipo_effects::Effects)
# If we decided not to optimize, drop the OptimizationState now.
# External interpreters can override as necessary to cache additional information
if inferred_result isa OptimizationState
Expand Down Expand Up @@ -391,7 +392,7 @@ function cache_result!(interp::AbstractInterpreter, result::InferenceResult)

# TODO: also don't store inferred code if we've previously decided to interpret this function
if !already_inferred
inferred_result = transform_result_for_cache(interp, linfo, valid_worlds, result.src)
inferred_result = transform_result_for_cache(interp, linfo, valid_worlds, result.src, result.ipo_effects)
code_cache(interp)[linfo] = CodeInstance(result, inferred_result, valid_worlds)
if track_newly_inferred[]
m = linfo.def
Expand Down

0 comments on commit d7782de

Please sign in to comment.