-
-
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
add a lattice element type for constants in inference #15785
Conversation
037e22e
to
922dcb5
Compare
|
922dcb5
to
3eaeb3c
Compare
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels |
@@ -1345,11 +1254,33 @@ function type_too_complex(t::ANY, d) | |||
return false | |||
end | |||
|
|||
## lattice operators | |||
|
|||
function ⊑(a::ANY, b::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.
does this reserve this unicode operator so packages can no longer use it?
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.
yes, but only for packages that start with import Core.Inference.⊑
:P
Anybody have opinions on the benchmark results? Worst number is 2.67x allocations on a sorting benchmark, which I can't reproduce locally. Another one has 0.03x allocations, which is pretty implausible. |
I've seen all of those benchmarks in previous reports. They seem to be a bit wonky. |
that does look strange. i think you may need to manually review the |
I think we'll only really need to worry if and when we can infer the type of |
3eaeb3c
to
7b940d9
Compare
All the benchmark changes reported here are known to be noisy (including the weird allocation counts reported by the sorting benchmarks). If they can't be reproduced locally, then you can chalk it up to noise. |
if isType(s) | ||
s = s.parameters[1] | ||
elseif isa(s,Const) | ||
s = typeof(s.val) |
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.
i think you would want s = s
here, to preserve the type identity
7b940d9
to
ee7f643
Compare
Comments addressed. |
hm, github isn't showing quite what I hoped for a diff here – i was attempting to push the merge commit here in an attempt to test it before submitting it to master |
…type, and typeassert
5466b77
to
c8d4f33
Compare
@JeffBezanson: Any chance you could make the following infer
|
This incorporates a bit of constant propagation into type inference, giving better type information and removing some special-case code we'd started accumulating.
Todo: