839839# the general resolver for usual and const-prop'ed calls
840840function resolve_todo (mi:: MethodInstance , result:: Union{MethodMatch,InferenceResult} ,
841841 argtypes:: Vector{Any} , @nospecialize (info:: CallInfo ), flag:: UInt8 ,
842- state:: InliningState ; invokesig:: Union{Nothing,Vector{Any}} = nothing ,
843- override_effects:: Effects = EFFECTS_UNKNOWN′)
842+ state:: InliningState ; invokesig:: Union{Nothing,Vector{Any}} = nothing )
844843 et = InliningEdgeTracker (state. et, invokesig)
845844
846845 # XXX : update_valid_age!(min_valid[1], max_valid[1], sv)
@@ -861,10 +860,6 @@ function resolve_todo(mi::MethodInstance, result::Union{MethodMatch,InferenceRes
861860 (; src, effects) = cached_result
862861 end
863862
864- if override_effects != = EFFECTS_UNKNOWN′
865- effects = override_effects
866- end
867-
868863 # the duplicated check might have been done already within `analyze_method!`, but still
869864 # we need it here too since we may come here directly using a constant-prop' result
870865 if ! state. params. inlining || is_stmt_noinline (flag)
@@ -942,8 +937,7 @@ can_inline_typevars(m::MethodMatch, argtypes::Vector{Any}) = can_inline_typevars
942937
943938function analyze_method! (match:: MethodMatch , argtypes:: Vector{Any} ,
944939 @nospecialize (info:: CallInfo ), flag:: UInt8 , state:: InliningState ;
945- allow_typevars:: Bool , invokesig:: Union{Nothing,Vector{Any}} = nothing ,
946- override_effects:: Effects = EFFECTS_UNKNOWN′)
940+ allow_typevars:: Bool , invokesig:: Union{Nothing,Vector{Any}} = nothing )
947941 method = match. method
948942 spec_types = match. spec_types
949943
@@ -973,13 +967,12 @@ function analyze_method!(match::MethodMatch, argtypes::Vector{Any},
973967 mi = specialize_method (match; preexisting= true ) # Union{Nothing, MethodInstance}
974968 if mi === nothing
975969 et = InliningEdgeTracker (state. et, invokesig)
976- effects = override_effects
977- effects === EFFECTS_UNKNOWN′ && (effects = info_effects (nothing , match, state))
970+ effects = info_effects (nothing , match, state)
978971 return compileable_specialization (match, effects, et, info;
979972 compilesig_invokes= state. params. compilesig_invokes)
980973 end
981974
982- return resolve_todo (mi, match, argtypes, info, flag, state; invokesig, override_effects )
975+ return resolve_todo (mi, match, argtypes, info, flag, state; invokesig)
983976end
984977
985978function retrieve_ir_for_inlining (mi:: MethodInstance , src:: Array{UInt8, 1} )
@@ -1178,7 +1171,6 @@ function handle_invoke_call!(todo::Vector{Pair{Int,Any}},
11781171 end
11791172 result = info. result
11801173 invokesig = sig. argtypes
1181- override_effects = EFFECTS_UNKNOWN′
11821174 if isa (result, ConcreteResult)
11831175 item = concrete_result_item (result, state, info; invokesig)
11841176 else
@@ -1187,12 +1179,12 @@ function handle_invoke_call!(todo::Vector{Pair{Int,Any}},
11871179 mi = result. result. linfo
11881180 validate_sparams (mi. sparam_vals) || return nothing
11891181 if argtypes_to_type (argtypes) <: mi.def.sig
1190- item = resolve_todo (mi, result. result, argtypes, info, flag, state; invokesig, override_effects )
1182+ item = resolve_todo (mi, result. result, argtypes, info, flag, state; invokesig)
11911183 handle_single_case! (todo, ir, idx, stmt, item, state. params, true )
11921184 return nothing
11931185 end
11941186 end
1195- item = analyze_method! (match, argtypes, info, flag, state; allow_typevars= false , invokesig, override_effects )
1187+ item = analyze_method! (match, argtypes, info, flag, state; allow_typevars= false , invokesig)
11961188 end
11971189 handle_single_case! (todo, ir, idx, stmt, item, state. params, true )
11981190 return nothing
@@ -1305,7 +1297,6 @@ function handle_any_const_result!(cases::Vector{InliningCase},
13051297 @nospecialize (result), match:: MethodMatch , argtypes:: Vector{Any} ,
13061298 @nospecialize (info:: CallInfo ), flag:: UInt8 , state:: InliningState ;
13071299 allow_abstract:: Bool , allow_typevars:: Bool )
1308- override_effects = EFFECTS_UNKNOWN′
13091300 if isa (result, ConcreteResult)
13101301 return handle_concrete_result! (cases, result, state, info)
13111302 end
@@ -1319,7 +1310,7 @@ function handle_any_const_result!(cases::Vector{InliningCase},
13191310 return handle_const_prop_result! (cases, result, argtypes, info, flag, state; allow_abstract, allow_typevars)
13201311 else
13211312 @assert result === nothing
1322- return handle_match! (cases, match, argtypes, info, flag, state; allow_abstract, allow_typevars, override_effects )
1313+ return handle_match! (cases, match, argtypes, info, flag, state; allow_abstract, allow_typevars)
13231314 end
13241315end
13251316
@@ -1450,14 +1441,14 @@ end
14501441function handle_match! (cases:: Vector{InliningCase} ,
14511442 match:: MethodMatch , argtypes:: Vector{Any} , @nospecialize (info:: CallInfo ), flag:: UInt8 ,
14521443 state:: InliningState ;
1453- allow_abstract:: Bool , allow_typevars:: Bool , override_effects :: Effects )
1444+ allow_abstract:: Bool , allow_typevars:: Bool )
14541445 spec_types = match. spec_types
14551446 allow_abstract || isdispatchtuple (spec_types) || return false
14561447 # We may see duplicated dispatch signatures here when a signature gets widened
14571448 # during abstract interpretation: for the purpose of inlining, we can just skip
14581449 # processing this dispatch candidate (unless unmatched type parameters are present)
14591450 ! allow_typevars && _any (case-> case. sig === spec_types, cases) && return true
1460- item = analyze_method! (match, argtypes, info, flag, state; allow_typevars, override_effects )
1451+ item = analyze_method! (match, argtypes, info, flag, state; allow_typevars)
14611452 item === nothing && return false
14621453 push! (cases, InliningCase (spec_types, item))
14631454 return true
0 commit comments