-
Notifications
You must be signed in to change notification settings - Fork 590
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
Extend redistribute_integer_pairs
to floats
#4222
Conversation
e08cf99
to
ef0205f
Compare
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.
Looks good overall, but see note about precision - I'd appreciate some more tests for nasty floating-point cases (small, large, infs, nans...) to check that when we shrink it's always to something smaller, which is true for integers but maybe not for floats.
@@ -1381,15 +1391,20 @@ def redistribute_integer_pairs(self, chooser): | |||
and node1.index < node.index <= node1.index + 4, | |||
) | |||
|
|||
m = node1.value | |||
n = node2.value | |||
m: Union[int, float] = node1.value |
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.
preempting a comment: distinguishing these two does actually matter for mypyc.
also addresses a TODO in
minimize_duplicated_nodes
.