839
839
# the general resolver for usual and const-prop'ed calls
840
840
function resolve_todo (mi:: MethodInstance , result:: Union{MethodMatch,InferenceResult} ,
841
841
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 )
844
843
et = InliningEdgeTracker (state. et, invokesig)
845
844
846
845
# XXX : update_valid_age!(min_valid[1], max_valid[1], sv)
@@ -861,10 +860,6 @@ function resolve_todo(mi::MethodInstance, result::Union{MethodMatch,InferenceRes
861
860
(; src, effects) = cached_result
862
861
end
863
862
864
- if override_effects != = EFFECTS_UNKNOWN′
865
- effects = override_effects
866
- end
867
-
868
863
# the duplicated check might have been done already within `analyze_method!`, but still
869
864
# we need it here too since we may come here directly using a constant-prop' result
870
865
if ! state. params. inlining || is_stmt_noinline (flag)
@@ -942,8 +937,7 @@ can_inline_typevars(m::MethodMatch, argtypes::Vector{Any}) = can_inline_typevars
942
937
943
938
function analyze_method! (match:: MethodMatch , argtypes:: Vector{Any} ,
944
939
@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 )
947
941
method = match. method
948
942
spec_types = match. spec_types
949
943
@@ -973,13 +967,12 @@ function analyze_method!(match::MethodMatch, argtypes::Vector{Any},
973
967
mi = specialize_method (match; preexisting= true ) # Union{Nothing, MethodInstance}
974
968
if mi === nothing
975
969
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)
978
971
return compileable_specialization (match, effects, et, info;
979
972
compilesig_invokes= state. params. compilesig_invokes)
980
973
end
981
974
982
- return resolve_todo (mi, match, argtypes, info, flag, state; invokesig, override_effects )
975
+ return resolve_todo (mi, match, argtypes, info, flag, state; invokesig)
983
976
end
984
977
985
978
function retrieve_ir_for_inlining (mi:: MethodInstance , src:: Array{UInt8, 1} )
@@ -1178,7 +1171,6 @@ function handle_invoke_call!(todo::Vector{Pair{Int,Any}},
1178
1171
end
1179
1172
result = info. result
1180
1173
invokesig = sig. argtypes
1181
- override_effects = EFFECTS_UNKNOWN′
1182
1174
if isa (result, ConcreteResult)
1183
1175
item = concrete_result_item (result, state, info; invokesig)
1184
1176
else
@@ -1187,12 +1179,12 @@ function handle_invoke_call!(todo::Vector{Pair{Int,Any}},
1187
1179
mi = result. result. linfo
1188
1180
validate_sparams (mi. sparam_vals) || return nothing
1189
1181
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)
1191
1183
handle_single_case! (todo, ir, idx, stmt, item, state. params, true )
1192
1184
return nothing
1193
1185
end
1194
1186
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)
1196
1188
end
1197
1189
handle_single_case! (todo, ir, idx, stmt, item, state. params, true )
1198
1190
return nothing
@@ -1305,7 +1297,6 @@ function handle_any_const_result!(cases::Vector{InliningCase},
1305
1297
@nospecialize (result), match:: MethodMatch , argtypes:: Vector{Any} ,
1306
1298
@nospecialize (info:: CallInfo ), flag:: UInt8 , state:: InliningState ;
1307
1299
allow_abstract:: Bool , allow_typevars:: Bool )
1308
- override_effects = EFFECTS_UNKNOWN′
1309
1300
if isa (result, ConcreteResult)
1310
1301
return handle_concrete_result! (cases, result, state, info)
1311
1302
end
@@ -1319,7 +1310,7 @@ function handle_any_const_result!(cases::Vector{InliningCase},
1319
1310
return handle_const_prop_result! (cases, result, argtypes, info, flag, state; allow_abstract, allow_typevars)
1320
1311
else
1321
1312
@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)
1323
1314
end
1324
1315
end
1325
1316
@@ -1450,14 +1441,14 @@ end
1450
1441
function handle_match! (cases:: Vector{InliningCase} ,
1451
1442
match:: MethodMatch , argtypes:: Vector{Any} , @nospecialize (info:: CallInfo ), flag:: UInt8 ,
1452
1443
state:: InliningState ;
1453
- allow_abstract:: Bool , allow_typevars:: Bool , override_effects :: Effects )
1444
+ allow_abstract:: Bool , allow_typevars:: Bool )
1454
1445
spec_types = match. spec_types
1455
1446
allow_abstract || isdispatchtuple (spec_types) || return false
1456
1447
# We may see duplicated dispatch signatures here when a signature gets widened
1457
1448
# during abstract interpretation: for the purpose of inlining, we can just skip
1458
1449
# processing this dispatch candidate (unless unmatched type parameters are present)
1459
1450
! 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)
1461
1452
item === nothing && return false
1462
1453
push! (cases, InliningCase (spec_types, item))
1463
1454
return true
0 commit comments