Skip to content

Commit

Permalink
adjust to the latest JuliaLang/julia#master
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Mar 1, 2023
1 parent 4c8f491 commit 92d880a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
10 changes: 7 additions & 3 deletions src/abstractinterpret/typeinfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -670,10 +670,14 @@ end
@doc """
bail_out_toplevel_call(analyzer::AbstractAnalyzer, ...)
An overload for `abstract_call_gf_by_type(analyzer::AbstractAnalyzer, ...)`, which keeps
inference on non-concrete call sites in a toplevel frame created by [`virtual_process`](@ref).
This overload allows JET to keep inference performed by `AbstractAnalyzer` going on
non-concrete call sites in a toplevel frame created by [`virtual_process`](@ref).
"""
CC.bail_out_toplevel_call(analyzer::AbstractAnalyzer, @nospecialize(sig), sv::InferenceState) = false
@static if VERSION v"1.10.0-DEV.679"
CC.bail_out_toplevel_call(::AbstractAnalyzer, ::CC.InferenceLoopState, ::InferenceState) = false
else
CC.bail_out_toplevel_call(::AbstractAnalyzer, @nospecialize(sig), ::InferenceState) = false
end

function CC.abstract_eval_special_value(analyzer::AbstractAnalyzer, @nospecialize(e), vtypes::VarTable, sv::InferenceState)
istoplevel = JET.istoplevel(sv)
Expand Down
15 changes: 9 additions & 6 deletions src/analyzers/jetanalyzer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,16 @@ end
@doc """
bail_out_call(analyzer::JETAnalyzer, ...)
With this overload, `abstract_call_gf_by_type(analyzer::JETAnalyzer, ...)` doesn't bail
out inference even after the current return type grows up to `Any` and collects as much
error points as possible.
Of course this slows down inference performance, but hopefully it stays to be "practical"
speed since the number of matching methods are limited beforehand.
This overload makes call inference performed by `JETAnalyzer` not bail out even when
inferred return type grows up to `Any` to collect as much error reports as possible.
That potentially slows down inference performance, but it would stay to be practical
given that the number of matching methods are limited beforehand.
"""
CC.bail_out_call(analyzer::JETAnalyzer, @nospecialize(t), sv::InferenceState) = false
@static if VERSION v"1.10.0-DEV.679"
CC.bail_out_call(::JETAnalyzer, ::CC.InferenceLoopState, ::InferenceState) = false
else
CC.bail_out_call(::JETAnalyzer, @nospecialize(t), ::InferenceState) = false
end

@doc """
add_call_backedges!(analyzer::JETAnalyzer, ...)
Expand Down

0 comments on commit 92d880a

Please sign in to comment.