@@ -725,7 +725,7 @@ function resolve_todo(todo::InliningTodo, state::InliningState, flag::UInt8)
725
725
(; match) = todo. spec:: DelayedInliningSpec
726
726
727
727
# XXX : update_valid_age!(min_valid[1], max_valid[1], sv)
728
- isconst, src, argtypes = false , nothing , nothing
728
+ isconst, src = false , nothing
729
729
if isa (match, InferenceResult)
730
730
let inferred_src = match. src
731
731
if isa (inferred_src, Const)
@@ -737,9 +737,6 @@ function resolve_todo(todo::InliningTodo, state::InliningState, flag::UInt8)
737
737
isconst, src = false , inferred_src
738
738
end
739
739
end
740
- if is_stmt_inline (flag)
741
- argtypes = match. argtypes
742
- end
743
740
else
744
741
linfo = get (state. mi_cache, todo. mi, nothing )
745
742
if linfo isa CodeInstance
@@ -752,9 +749,6 @@ function resolve_todo(todo::InliningTodo, state::InliningState, flag::UInt8)
752
749
else
753
750
isconst, src = false , linfo
754
751
end
755
- if is_stmt_inline (flag)
756
- argtypes = collect (todo. mi. specTypes. parameters):: Vector{Any}
757
- end
758
752
end
759
753
760
754
et = state. et
@@ -764,18 +758,7 @@ function resolve_todo(todo::InliningTodo, state::InliningState, flag::UInt8)
764
758
return ConstantCase (src)
765
759
end
766
760
767
- if argtypes != = nothing && src === nothing
768
- inf_cache = state. inf_cache
769
- inf_result = cache_lookup (todo. mi, argtypes, inf_cache)
770
- if isa (inf_result, InferenceResult)
771
- src = inf_result. src
772
- if isa (src, OptimizationState)
773
- src = src. src
774
- end
775
- end
776
- end
777
-
778
- src = state. policy (src, flag, match)
761
+ src = inlining_policy (state. interp, src, flag, match)
779
762
780
763
if src === nothing
781
764
return compileable_specialization (et, match)
@@ -1419,7 +1402,8 @@ end
1419
1402
function late_inline_special_case! (ir:: IRCode , sig:: Signature , idx:: Int , stmt:: Expr , params:: OptimizationParams )
1420
1403
f, ft, atypes = sig. f, sig. ft, sig. atypes
1421
1404
typ = ir. stmts[idx][:type ]
1422
- if params. inlining && length (atypes) == 3 && istopfunction (f, :!= = )
1405
+ isinlining = params. inlining
1406
+ if isinlining && length (atypes) == 3 && istopfunction (f, :!= = )
1423
1407
# special-case inliner for !== that precedes _methods_by_ftype union splitting
1424
1408
# and that works, even though inference generally avoids inferring the `!==` Method
1425
1409
if isa (typ, Const)
@@ -1431,7 +1415,7 @@ function late_inline_special_case!(ir::IRCode, sig::Signature, idx::Int, stmt::E
1431
1415
not_call = Expr (:call , GlobalRef (Core. Intrinsics, :not_int ), cmp_call_ssa)
1432
1416
ir[SSAValue (idx)] = not_call
1433
1417
return true
1434
- elseif params . inlining && length (atypes) == 3 && istopfunction (f, :(> :))
1418
+ elseif isinlining && length (atypes) == 3 && istopfunction (f, :(> :))
1435
1419
# special-case inliner for issupertype
1436
1420
# that works, even though inference generally avoids inferring the `>:` Method
1437
1421
if isa (typ, Const) && _builtin_nothrow (< :, Any[atypes[3 ], atypes[2 ]], typ)
@@ -1441,7 +1425,7 @@ function late_inline_special_case!(ir::IRCode, sig::Signature, idx::Int, stmt::E
1441
1425
subtype_call = Expr (:call , GlobalRef (Core, :(< :)), stmt. args[3 ], stmt. args[2 ])
1442
1426
ir[SSAValue (idx)] = subtype_call
1443
1427
return true
1444
- elseif params . inlining && f === TypeVar && 2 <= length (atypes) <= 4 && (atypes[2 ] ⊑ Symbol)
1428
+ elseif isinlining && f === TypeVar && 2 <= length (atypes) <= 4 && (atypes[2 ] ⊑ Symbol)
1445
1429
ir[SSAValue (idx)] = Expr (:call , GlobalRef (Core, :_typevar ), stmt. args[2 ],
1446
1430
length (stmt. args) < 4 ? Bottom : stmt. args[3 ],
1447
1431
length (stmt. args) == 2 ? Any : stmt. args[end ])
0 commit comments