-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
inference: avoid LimitedAccuracy
within slot wrappers
#59182
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
I looked at all the usage sites of these constructors within the compiler, and fortunately it appears that none of the usage sites require that the return values of these constructors be objects of their respective types. So in cases where `LimitedAccuracy` is given as a wrapped element, these slot type refinements simply will not be performed. - fixes #59004
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.
Thanks!
assert_nested_slotwrapper(thentype) | ||
assert_nested_slotwrapper(elsetype) | ||
if thentype isa LimitedAccuracy || elsetype isa LimitedAccuracy | ||
return Bool |
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.
Technically this is required to be a LimitedAccuracy(Bool) to prevent caching the bad result (same everywhere in this PR)
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 don't think that's necessary?
Conditional(slot, thentype, elsetype)
does not represent the type of slot
that can either be thentype
or elsetype
, but just represents the type of the condition. So I don't think we need to pass along the limited accuracy information coming along with thentype
/elsetype
.
MustAlias(slot, vartyp, fldidx, fldtyp)
represents the type of fldtyp
, but if fldtyp
is LimitedAccuracy
, it's returned unchanged.
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.
LimitedAccuracy
also doesn't represent the type of the slot
, but rather represents that the computation of it was widened to be incomplete (exactly what happened 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.
Ok, I understand. |
I looked at all the usage sites of these constructors within the compiler, and fortunately it appears that none of the usage sites require that the return values of these constructors be objects of their respective types. So in cases where `LimitedAccuracy` is given as a wrapped element, these slot type refinements simply will not be performed. - fixes #59004
According to Jameson's comment, we should propagate `LimitedAccuracy` information not only when we actually use the type information of variables that are `LimitedAccuracy`, but also when we perform computations involving variables that are `LimitedAccuracy`. This commit implements that propagation in relation to #59182.
According to Jameson's comment, we should propagate `LimitedAccuracy` information not only when we actually use the type information of variables that are `LimitedAccuracy`, but also when we perform computations involving variables that are `LimitedAccuracy`. This commit implements that propagation in relation to #59182.
I looked at all the usage sites of these constructors within the compiler, and fortunately it appears that none of the usage sites require that the return values of these constructors be objects of their respective types. So in cases where `LimitedAccuracy` is given as a wrapped element, these slot type refinements simply will not be performed. - fixes #59004
I just ran into #59004 (on |
It's already on |
I looked at all the usage sites of these constructors within the compiler, and fortunately it appears that none of the usage sites require that the return values of these constructors be objects of their respective types. So in cases where `LimitedAccuracy` is given as a wrapped element, these slot type refinements simply will not be performed. - fixes #59004
I looked at all the usage sites of these constructors within the compiler, and fortunately it appears that none of the usage sites require that the return values of these constructors be objects of their respective types. So in cases where
LimitedAccuracy
is given as a wrapped element, these slot type refinements simply will not be performed.