-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Improve inference SCC '[limited]' code computation #39116
Conversation
75181fb
to
bfc3b2a
Compare
I'm not sure why the status didn't update when those finished. I suppose it got confused. The only one waiting on is https://build.julialang.org/#/builders/39/builds/6682 |
@@ -56,6 +56,7 @@ end | |||
|
|||
# Wraps a type and represents that the value may also be undef at this point. | |||
# (only used in optimize, not abstractinterpret) | |||
# N.B. in the lattice, this is epsilon bigger than `typ` (even Any) |
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.
What does N.B.
expand to? :)
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.
nota bene (tr. note well!)
bfc3b2a
to
387903a
Compare
Don't know what the doctest machine segfaults because of this, since I can't reproduce and this otherwise is done. |
elseif typeb.causes ⊆ typea.causes | ||
causes = typea.causes | ||
else | ||
causes = union!(copy(typea.causes), typeb.causes) |
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.
Any reason not to use plain union
here?
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, it doesn’t make an IdDict. We should perhaps change that
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.
Ah, wait, that is a holdover from when this was a Dict and used merge
, for union on IdSet, it would be okay.
julia> merge(IdDict(), IdDict())
Dict{Any, Any}()
387903a
to
b5bc366
Compare
This helps refine our knowledge of the `[limited]` flag setting, which previously would always exclude a result from the cache when hitting a cycle. However, we really only need to exclude a result if the result might be dependent on that flag setting. That makes this formally part of the lattice, though can be annoying to work with yet another wrapper, so we try to add/remove it late/early to propagate it when necessary.
b5bc366
to
cf01a76
Compare
Running doctest with FORCE_ASSERTIONS, it seems to have turned out to be fixed by #39246. Let's see how this does now. |
Probably needs a rebase to catch #39263 to make doctests pass. |
That is acceptable, we know this would have passed. @JeffBezanson GTG? |
@@ -443,7 +454,8 @@ function abstract_call_method(interp::AbstractInterpreter, method::Method, @nosp | |||
# (non-typically, this means that we lose the ability to detect a guaranteed StackOverflow in some cases) | |||
return Any, true, nothing | |||
end | |||
poison_callstack(sv, topmost::InferenceState, true) | |||
topmost = topmost::InferenceState | |||
poison_callstack(sv, topmost.parent === nothing ? topmost : topmost.parent) |
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.
nit pick;
poison_callstack(sv, topmost.parent === nothing ? topmost : topmost.parent) | |
parent = topmost.parent | |
poison_callstack(sv, parent === nothing ? topmost : parent) |
This is great, thanks Jameson! :) |
Hm, the doctest failure looks real. Perhaps Kristoffer's comment
is relevant, given it looks like the last rebase was before 39263? |
This helps refine our knowledge of the `[limited]` flag setting, which previously would always exclude a result from the cache when hitting a cycle. However, we really only need to exclude a result if the result might be dependent on that flag setting. That makes this formally part of the lattice, though can be annoying to work with yet another wrapper, so we try to add/remove it late/early to propagate it when necessary. (cherry picked from commit 5f10eb9)
This helps refine our knowledge of the `[limited]` flag setting, which previously would always exclude a result from the cache when hitting a cycle. However, we really only need to exclude a result if the result might be dependent on that flag setting. That makes this formally part of the lattice, though can be annoying to work with yet another wrapper, so we try to add/remove it late/early to propagate it when necessary. (cherry picked from commit 5f10eb9)
This helps refine our knowledge of the `[limited]` flag setting, which previously would always exclude a result from the cache when hitting a cycle. However, we really only need to exclude a result if the result might be dependent on that flag setting. That makes this formally part of the lattice, though can be annoying to work with yet another wrapper, so we try to add/remove it late/early to propagate it when necessary. (cherry picked from commit 5f10eb9)
…39116) This helps refine our knowledge of the `[limited]` flag setting, which previously would always exclude a result from the cache when hitting a cycle. However, we really only need to exclude a result if the result might be dependent on that flag setting. That makes this formally part of the lattice, though can be annoying to work with yet another wrapper, so we try to add/remove it late/early to propagate it when necessary.
…39116) This helps refine our knowledge of the `[limited]` flag setting, which previously would always exclude a result from the cache when hitting a cycle. However, we really only need to exclude a result if the result might be dependent on that flag setting. That makes this formally part of the lattice, though can be annoying to work with yet another wrapper, so we try to add/remove it late/early to propagate it when necessary.
This helps refine our knowledge of the `[limited]` flag setting, which previously would always exclude a result from the cache when hitting a cycle. However, we really only need to exclude a result if the result might be dependent on that flag setting. That makes this formally part of the lattice, though can be annoying to work with yet another wrapper, so we try to add/remove it late/early to propagate it when necessary. (cherry picked from commit 5f10eb9)
This implements the idea described in #38517, with other substantial additional refinements.