-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
inference: minor refactoring on abstractinterpretation.jl #58154
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
Conversation
| (b::Core.Binding, bpart::Core.BindingPartition, world::UInt)-> | ||
| Pair{WorldRange, Pair{Core.Binding, Core.BindingPartition}}(WorldRange(bpart.min_world, bpart.max_world), b=>bpart), | ||
| interp, g, wwr) | ||
| function scan_partitions(query::Function, interp::AbstractInterpreter, g::GlobalRef, wwr::WorldWithRange) |
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.
Do we mean for these all to be ::F {where F<:Function} ?
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.
Does ::F where F<:Function still lead to different specialization than ::Function? I'm just borrowing this annotation from what @Keno is using elsewhere.
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.
Yeah, get_compileable_sig still implements the de-specialization heuristics.
I'd change these signatures in a separate PR.
| return Pair{Any,Any}(newty, ErrorException) | ||
| end | ||
| (valid_worlds, ret) = scan_partitions((interp, _, partition)->global_assignment_binding_rt_exct(interp, partition, newty), interp, g, sv.world) | ||
| newty′ = Ref{Any}(newty) |
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.
| newty′ = Ref{Any}(newty) | |
| newty′ = Core.Box(newty) |
I think that's a bit more canonical (esp for JET and other analysis tools)?
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.
JET can analyze both cases.
Since the frontend inserts Core.Box, are you suggesting we should consistently use Core.Box for captured variables?
I slightly prefer Ref because .contents is a bit long, but I don't have a strong preference.
- add missing `@nospecialize` annotation - add more type annotations to functions - fixed capturing uninferrable variables
86ea8e9 to
939ead0
Compare
- add missing `@nospecialize` annotation - add more type annotations to functions - fixed capturing uninferrable variables
…58154) - add missing `@nospecialize` annotation - add more type annotations to functions - fixed capturing uninferrable variables
…58154) - add missing `@nospecialize` annotation - add more type annotations to functions - fixed capturing uninferrable variables
@nospecializeannotation