Skip to content

Commit

Permalink
optimizer: remove dead OptimizationState handling in `inlining_poli…
Browse files Browse the repository at this point in the history
…cy` (#43378)

`NativeInterpreter` never hits this case, and external interpreters can
always define their own `inlining_policy` in order to use whichever
information they are caching.
  • Loading branch information
aviatesk authored Dec 10, 2021
1 parent 07e5bd3 commit 524bca4
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions base/compiler/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ function inlining_policy(interp::AbstractInterpreter, @nospecialize(src), stmt_f
src_inferred = ccall(:jl_ir_flag_inferred, Bool, (Any,), src)
src_inlineable = is_stmt_inline(stmt_flag) || ccall(:jl_ir_flag_inlineable, Bool, (Any,), src)
return src_inferred && src_inlineable ? src : nothing
elseif isa(src, OptimizationState) && isdefined(src, :ir)
return (is_stmt_inline(stmt_flag) || src.src.inlineable) ? src.ir : nothing
elseif src === nothing && is_stmt_inline(stmt_flag)
# if this statement is forced to be inlined, make an additional effort to find the
# inferred source in the local cache
Expand All @@ -47,8 +45,6 @@ function inlining_policy(interp::AbstractInterpreter, @nospecialize(src), stmt_f
if isa(src, CodeInfo)
src_inferred = ccall(:jl_ir_flag_inferred, Bool, (Any,), src)
return src_inferred ? src : nothing
elseif isa(src, OptimizationState)
return isdefined(src, :ir) ? src.ir : nothing
else
return nothing
end
Expand Down

2 comments on commit 524bca4

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package evaluation job has completed - possible new issues were detected. A full report can be found here.

Please sign in to comment.