Skip to content

Commit

Permalink
cleanups on src_inlining_policy (#53599)
Browse files Browse the repository at this point in the history
- fixed the check with `src_inlining_policy` in typeinfer.jl
- removed the `SemiConcreteResult` handling, which is no longer needed
  • Loading branch information
aviatesk authored Mar 6, 2024
1 parent fb71a5d commit 90d84d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 0 additions & 4 deletions base/compiler/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,11 @@ function src_inlining_policy(interp::AbstractInterpreter,
return src_inlineable
elseif isa(src, IRCode)
return true
elseif isa(src, SemiConcreteResult)
return true
end
@assert !isa(src, CodeInstance) # handled by caller
return false
end

function inlining_policy end # deprecated legacy name used by Cthulhu

struct InliningState{Interp<:AbstractInterpreter}
edges::Vector{Any}
world::UInt
Expand Down
3 changes: 2 additions & 1 deletion base/compiler/typeinfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,8 @@ function typeinf_edge(interp::AbstractInterpreter, method::Method, @nospecialize
exc_bestguess = refine_exception_type(frame.exc_bestguess, effects)
# propagate newly inferred source to the inliner, allowing efficient inlining w/o deserialization:
# note that this result is cached globally exclusively, we can use this local result destructively
volatile_inf_result = isinferred && (force_inline || src_inlining_policy(interp, result.src, NoCallInfo(), IR_FLAG_NULL) !== nothing) ?
volatile_inf_result = (isinferred && (force_inline ||
src_inlining_policy(interp, result.src, NoCallInfo(), IR_FLAG_NULL))) ?
VolatileInferenceResult(result) : nothing
return EdgeCallResult(frame.bestguess, exc_bestguess, edge, effects, volatile_inf_result)
elseif frame === true
Expand Down

0 comments on commit 90d84d4

Please sign in to comment.