Skip to content

Commit

Permalink
AbstractInterpreter: pass InferenceResult to `transform_result_fo…
Browse files Browse the repository at this point in the history
…r_cache` (#46488)

This allows external `AbstractInterpreter`s to cache customized
information more easily.
  • Loading branch information
aviatesk authored Aug 26, 2022
1 parent dfbb9c4 commit 293031b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions base/compiler/typeinfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,9 @@ function maybe_compress_codeinfo(interp::AbstractInterpreter, linfo::MethodInsta
end
end

function transform_result_for_cache(interp::AbstractInterpreter, linfo::MethodInstance,
valid_worlds::WorldRange, @nospecialize(inferred_result),
ipo_effects::Effects)
function transform_result_for_cache(interp::AbstractInterpreter,
linfo::MethodInstance, valid_worlds::WorldRange, result::InferenceResult)
inferred_result = result.src
# 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 @@ -385,7 +385,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, result.ipo_effects)
inferred_result = transform_result_for_cache(interp, linfo, valid_worlds, result)
code_cache(interp)[linfo] = CodeInstance(result, inferred_result, valid_worlds)
if track_newly_inferred[]
m = linfo.def
Expand Down

2 comments on commit 293031b

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package evaluation job has completed - possible new issues were detected. A full report can be found here.

Please sign in to comment.