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