From 33da26a616acf6c426f67c2bd0ee2bfbd09aec90 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Tue, 5 Mar 2024 16:35:57 +0900 Subject: [PATCH] inlining: remove unused `allow_abstract::Bool` keyword argument --- base/compiler/ssair/inlining.jl | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/base/compiler/ssair/inlining.jl b/base/compiler/ssair/inlining.jl index 164102758a88f..1bfd69d85c844 100644 --- a/base/compiler/ssair/inlining.jl +++ b/base/compiler/ssair/inlining.jl @@ -1296,16 +1296,16 @@ end function handle_any_const_result!(cases::Vector{InliningCase}, @nospecialize(result), match::MethodMatch, argtypes::Vector{Any}, @nospecialize(info::CallInfo), flag::UInt32, state::InliningState; - allow_abstract::Bool, allow_typevars::Bool) + allow_typevars::Bool) if isa(result, ConcreteResult) return handle_concrete_result!(cases, result, match, info, state) elseif isa(result, SemiConcreteResult) - return handle_semi_concrete_result!(cases, result, match, info, flag, state; allow_abstract) + return handle_semi_concrete_result!(cases, result, match, info, flag, state) elseif isa(result, ConstPropResult) - return handle_const_prop_result!(cases, result, match, info, flag, state; allow_abstract, allow_typevars) + return handle_const_prop_result!(cases, result, match, info, flag, state; allow_typevars) else @assert result === nothing || result isa VolatileInferenceResult - return handle_match!(cases, match, argtypes, info, flag, state; allow_abstract, allow_typevars, volatile_inf_result = result) + return handle_match!(cases, match, argtypes, info, flag, state; allow_typevars, volatile_inf_result = result) end end @@ -1370,7 +1370,7 @@ function compute_inlining_cases(@nospecialize(info::CallInfo), flag::UInt32, sig handled_all_cases = false else handled_all_cases &= handle_any_const_result!(cases, - result, match, argtypes, info, flag, state; allow_abstract=true, allow_typevars=false) + result, match, argtypes, info, flag, state; allow_typevars=false) end end fully_covered &= split_fully_covered @@ -1386,7 +1386,7 @@ function compute_inlining_cases(@nospecialize(info::CallInfo), flag::UInt32, sig match = getsplit(info, i)[j] result = getresult(info, k) handled_all_cases &= handle_any_const_result!(cases, - result, match, argtypes, info, flag, state; allow_abstract=true, allow_typevars=true) + result, match, argtypes, info, flag, state; allow_typevars=true) end elseif !isempty(cases) # if we've not seen all candidates, union split is valid only for dispatch tuples @@ -1409,10 +1409,8 @@ end function handle_match!(cases::Vector{InliningCase}, match::MethodMatch, argtypes::Vector{Any}, @nospecialize(info::CallInfo), flag::UInt32, state::InliningState; - allow_abstract::Bool, allow_typevars::Bool, - volatile_inf_result::Union{Nothing,VolatileInferenceResult}) + allow_typevars::Bool, volatile_inf_result::Union{Nothing,VolatileInferenceResult}) spec_types = match.spec_types - allow_abstract || isdispatchtuple(spec_types) || return false # We may see duplicated dispatch signatures here when a signature gets widened # during abstract interpretation: for the purpose of inlining, we can just skip # processing this dispatch candidate (unless unmatched type parameters are present) @@ -1425,10 +1423,9 @@ end function handle_const_prop_result!(cases::Vector{InliningCase}, result::ConstPropResult, match::MethodMatch, @nospecialize(info::CallInfo), flag::UInt32, state::InliningState; - allow_abstract::Bool, allow_typevars::Bool) + allow_typevars::Bool) mi = result.result.linfo spec_types = match.spec_types - allow_abstract || isdispatchtuple(spec_types) || return false if !validate_sparams(mi.sparam_vals) (allow_typevars && !may_have_fcalls(mi.def::Method)) || return false end @@ -1462,11 +1459,9 @@ function semiconcrete_result_item(result::SemiConcreteResult, end function handle_semi_concrete_result!(cases::Vector{InliningCase}, result::SemiConcreteResult, - match::MethodMatch, @nospecialize(info::CallInfo), flag::UInt32, state::InliningState; - allow_abstract::Bool) + match::MethodMatch, @nospecialize(info::CallInfo), flag::UInt32, state::InliningState) mi = result.mi spec_types = match.spec_types - allow_abstract || isdispatchtuple(spec_types) || return false validate_sparams(mi.sparam_vals) || return false item = semiconcrete_result_item(result, info, flag, state) item === nothing && return false