Skip to content

Commit

Permalink
Fix inlining for nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Oct 22, 2024
1 parent 1c69a70 commit 785c860
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/compiler/interpreter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ let # overload `inlining_policy`
argtypes::Vector{Any},
)
end
@static isdefined(Core.Compiler, :inlining_policy)
@eval function Core.Compiler.inlining_policy($(sigs_ex.args...))
if info isa NoInlineCallInfo
if info.kind === :primitive
Expand All @@ -266,6 +267,27 @@ let # overload `inlining_policy`
end
return @invoke Core.Compiler.inlining_policy($(args_ex.args...))
end
else
@eval function Core.Compiler.src_inlining_policy($(sigs_ex.args...))
if info isa NoInlineCallInfo
if info.kind === :primitive
@safe_debug "Blocking inlining for primitive func" info.tt
elseif info.kind === :inactive
@safe_debug "Blocking inlining due to inactive rule" info.tt
elseif info.kind === :frule
@safe_debug "Blocking inlining due to frule" info.tt
else
@assert info.kind === :rrule
@safe_debug "Blocking inlining due to rrule" info.tt
end
return nothing
elseif info isa AlwaysInlineCallInfo
@safe_debug "Forcing inlining for primitive func" info.tt
return src
end
return @invoke Core.Compiler.src_inlining_policy($(args_ex.args...))
end
end
end

import Core.Compiler:
Expand Down

0 comments on commit 785c860

Please sign in to comment.