Skip to content

Commit

Permalink
Revert "fix #45440, improve the robustness of concrete-evaled callsit…
Browse files Browse the repository at this point in the history
…e inlining (#45451)"

This reverts commit 08a9c12.
  • Loading branch information
aviatesk committed May 27, 2022
1 parent 84e9989 commit 678b21f
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions base/compiler/ssair/inlining.jl
Original file line number Diff line number Diff line change
Expand Up @@ -788,20 +788,20 @@ end

function compileable_specialization(et::Union{EdgeTracker, Nothing}, match::MethodMatch, effects::Effects)
mi = specialize_method(match; compilesig=true)
mi !== nothing && et !== nothing && push!(et, mi::MethodInstance)
mi === nothing && return nothing
et !== nothing && push!(et, mi)
return InvokeCase(mi, effects)
end

function compileable_specialization(et::Union{EdgeTracker, Nothing}, linfo::MethodInstance, effects::Effects)
mi = specialize_method(linfo.def::Method, linfo.specTypes, linfo.sparam_vals; compilesig=true)
mi !== nothing && et !== nothing && push!(et, mi::MethodInstance)
mi === nothing && return nothing
et !== nothing && push!(et, mi)
return InvokeCase(mi, effects)
end

function compileable_specialization(et::Union{EdgeTracker, Nothing}, result::InferenceResult, effects::Effects)
return compileable_specialization(et, result.linfo, effects)
function compileable_specialization(et::Union{EdgeTracker, Nothing}, (; linfo)::InferenceResult, effects::Effects)
return compileable_specialization(et, linfo, effects)
end

function resolve_todo(todo::InliningTodo, state::InliningState, flag::UInt8)
Expand Down Expand Up @@ -1283,11 +1283,7 @@ function handle_const_call!(
any_fully_covered |= match.fully_covers
if isa(result, ConcreteResult)
case = concrete_result_item(result, state)
if case === nothing
handled_all_cases = false
else
push!(cases, InliningCase(result.mi.specTypes, case))
end
push!(cases, InliningCase(result.mi.specTypes, case))
elseif isa(result, ConstPropResult)
handled_all_cases &= handle_const_prop_result!(result, argtypes, flag, state, cases, true)
else
Expand Down

0 comments on commit 678b21f

Please sign in to comment.