@@ -937,7 +937,6 @@ function analyze_method!(match::MethodMatch, argtypes::Vector{Any},
937
937
allow_typevars:: Bool , invokesig:: Union{Nothing,Vector{Any}} = nothing ,
938
938
volatile_inf_result:: Union{Nothing,VolatileInferenceResult} = nothing )
939
939
method = match. method
940
- spec_types = match. spec_types
941
940
942
941
# Check that we have the correct number of arguments
943
942
na = Int (method. nargs)
@@ -952,6 +951,7 @@ function analyze_method!(match::MethodMatch, argtypes::Vector{Any},
952
951
if ! match. fully_covers
953
952
# type-intersection was not able to give us a simple list of types, so
954
953
# ir_inline_unionsplit won't be able to deal with inlining this
954
+ spec_types = match. spec_types
955
955
if ! (spec_types isa DataType && length (spec_types. parameters) == npassedargs &&
956
956
! isvarargtype (spec_types. parameters[end ]))
957
957
return nothing
@@ -1424,28 +1424,26 @@ function handle_match!(cases::Vector{InliningCase},
1424
1424
match:: MethodMatch , argtypes:: Vector{Any} , @nospecialize (info:: CallInfo ), flag:: UInt32 ,
1425
1425
state:: InliningState ;
1426
1426
allow_typevars:: Bool , volatile_inf_result:: Union{Nothing,VolatileInferenceResult} )
1427
- spec_types = match. spec_types
1428
1427
# We may see duplicated dispatch signatures here when a signature gets widened
1429
1428
# during abstract interpretation: for the purpose of inlining, we can just skip
1430
1429
# processing this dispatch candidate (unless unmatched type parameters are present)
1431
- ! allow_typevars && any (case:: InliningCase -> case. sig === spec_types, cases) && return true
1430
+ ! allow_typevars && any (case:: InliningCase -> case. sig === match . spec_types, cases) && return true
1432
1431
item = analyze_method! (match, argtypes, info, flag, state; allow_typevars, volatile_inf_result)
1433
1432
item === nothing && return false
1434
- push! (cases, InliningCase (spec_types, item))
1433
+ push! (cases, InliningCase (match . spec_types, item))
1435
1434
return true
1436
1435
end
1437
1436
1438
1437
function handle_const_prop_result! (cases:: Vector{InliningCase} , result:: ConstPropResult ,
1439
1438
match:: MethodMatch , @nospecialize (info:: CallInfo ), flag:: UInt32 , state:: InliningState ;
1440
1439
allow_typevars:: Bool )
1441
1440
mi = result. result. linfo
1442
- spec_types = match. spec_types
1443
1441
if ! validate_sparams (mi. sparam_vals)
1444
1442
(allow_typevars && ! may_have_fcalls (mi. def:: Method )) || return false
1445
1443
end
1446
1444
item = resolve_todo (mi, result. result, info, flag, state)
1447
1445
item === nothing && return false
1448
- push! (cases, InliningCase (spec_types, item))
1446
+ push! (cases, InliningCase (match . spec_types, item))
1449
1447
return true
1450
1448
end
1451
1449
@@ -1473,11 +1471,10 @@ end
1473
1471
function handle_semi_concrete_result! (cases:: Vector{InliningCase} , result:: SemiConcreteResult ,
1474
1472
match:: MethodMatch , @nospecialize (info:: CallInfo ), flag:: UInt32 , state:: InliningState )
1475
1473
mi = result. edge. def
1476
- spec_types = match. spec_types
1477
1474
validate_sparams (mi. sparam_vals) || return false
1478
1475
item = semiconcrete_result_item (result, info, flag, state)
1479
1476
item === nothing && return false
1480
- push! (cases, InliningCase (spec_types, item))
1477
+ push! (cases, InliningCase (match . spec_types, item))
1481
1478
return true
1482
1479
end
1483
1480
0 commit comments