-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
optimizer: determine inlineability at callsite of is_inlineable
#48257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. |
Keno
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall
c4f2391 to
c4b5274
Compare
|
@nanosoldier |
|
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. |
c4b5274 to
3c6c967
Compare
|
@nanosoldier |
|
@nanosoldier |
|
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. |
3c6c967 to
7bad950
Compare
|
Your job failed. |
@maleadt I needed to fix this manually |
|
Will this affect checks like in precompile_utils.c? |
Yes, and I think we can safely replace that condition with julia/base/compiler/typeinfer.jl Lines 349 to 352 in 7bad950
(I'm not sure why we don't want to discard non-inlineable sources that are isa_compileable_sig though)
EDIT: we can't use the |
7bad950 to
1120df3
Compare
1120df3 to
af51073
Compare
|
@nanosoldier |
|
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. |
5b5e6ec to
3bebd67
Compare
src/precompile_utils.c
Outdated
| if (inferred && | ||
| inferred != jl_nothing && | ||
| jl_ir_flag_inferred((jl_array_t*)inferred) && | ||
| (jl_ir_inlining_cost((jl_array_t*)inferred) == UINT16_MAX)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vchuravy Could you please elaborate why we have this check and want to precompile sources that aren't inlineable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, so it's pretty effective, since we hit this condition when the isa_compileable_sig(linfo.specTypes, linfo.sparam_vals, def) case in this line holds
julia/base/compiler/typeinfer.jl
Line 344 in 93df7e2
| cache_the_tree = ci.inferred && (is_inlineable(ci) || isa_compileable_sig(linfo.specTypes, linfo.sparam_vals, def)) |
, which happens pretty frequently.
c9c9c95 to
14454bf
Compare
|
@nanosoldier |
|
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. |
c49de5a to
7803de2
Compare
|
@nanosoldier |
|
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. |
Now `src::CodeInfo` stores an inlining cost that is computed by `inlining_cost` function no matter if it is lower than or higher than the default `inline_cost_threshold`. This allows `AbstractInterpreter`s to determine the inlineability of `src` on the fly.
7803de2 to
ad06a5c
Compare
Now
src::CodeInfostores an inlining cost that is computed byinlining_costfunction no matter if it is lower than or higher than the defaultinline_cost_threshold. This allowsAbstractInterpreters to determine the inlineability ofsrcon the fly.This PR completes #45378.
@nanosoldier
runbenchmarks("inference", vs=":master")