Skip to content

Commit

Permalink
implement Jameson's idea
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Oct 31, 2023
1 parent 35630bd commit a772055
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions base/compiler/ssair/inlining.jl
Original file line number Diff line number Diff line change
Expand Up @@ -901,10 +901,16 @@ function resolve_todo(mi::MethodInstance, result::Union{MethodMatch,InferenceRes
compilesig_invokes=OptimizationParams(state.interp).compilesig_invokes)

add_inlining_backedge!(et, mi)

if src isa String && inferred_result !== nothing
src = inferred_result.inferred_src
# if the inferred source for this globally-cached method is available,
# use it destructively as it will never be used again
ir = inflate_ir!(inferred_result.inferred_src, mi)
else
ir = retrieve_ir_for_inlining(mi, src)
end
return InliningTodo(mi, retrieve_ir_for_inlining(mi, src), effects)

return InliningTodo(mi, ir, effects)
end

# the special resolver for :invoke-d call
Expand Down Expand Up @@ -1468,6 +1474,7 @@ function handle_call!(todo::Vector{Pair{Int,Any}},
ir::IRCode, idx::Int, stmt::Expr, @nospecialize(info::CallInfo), flag::UInt32, sig::Signature,
state::InliningState)
cases = compute_inlining_cases(info, flag, sig, state)
info isa ConstCallInfo && empty!(info.results) # clear code to save memory
cases === nothing && return nothing
cases, all_covered, joint_effects = cases
handle_cases!(todo, ir, idx, stmt, argtypes_to_type(sig.argtypes), cases,
Expand Down

0 comments on commit a772055

Please sign in to comment.