Skip to content

Commit 9daeadd

Browse files
Ian AtolKristofferC
authored andcommitted
Pass around effects during cacheing (#44777)
(cherry picked from commit d7782de)
1 parent c38e892 commit 9daeadd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

base/compiler/typeinfer.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,8 @@ function maybe_compress_codeinfo(interp::AbstractInterpreter, linfo::MethodInsta
356356
end
357357

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

392393
# TODO: also don't store inferred code if we've previously decided to interpret this function
393394
if !already_inferred
394-
inferred_result = transform_result_for_cache(interp, linfo, valid_worlds, result.src)
395+
inferred_result = transform_result_for_cache(interp, linfo, valid_worlds, result.src, result.ipo_effects)
395396
code_cache(interp)[linfo] = CodeInstance(result, inferred_result, valid_worlds)
396397
if track_newly_inferred[]
397398
m = linfo.def

0 commit comments

Comments
 (0)