-
-
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
fix part of #38936, getfield elim handling union of tuples #39107
Conversation
This fixes the regression since 1.5
if n == -1 | ||
n = length(t.parameters) | ||
elseif n != length(t.parameters) | ||
return u |
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.
we could also bin them by length/type, but I suppose the observation is that this caller doesn't need that?
ts = uniontypes(u) | ||
n = -1 | ||
for t in ts | ||
if t isa DataType && t.name === Tuple.name && !isvarargtype(t.parameters[end]) |
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.
We might still want to identify Tuple{Vararg{Integer, 2}}
as equivalent to Tuple{Integer, Integer}
? Though it would be much more complex.
@JeffBezanson Thank you. This works splendidly on our benchmark. 1.7.0-DEV.235 (~162μs) vs 1.7.0-DEV.207 (~246μs) vs 1.5.3 (~180μs). |
This fixes the regression since 1.5 (cherry picked from commit c70a5bc)
This fixes the regression since 1.5 (cherry picked from commit c70a5bc)
…uliaLang#39107) This fixes the regression since 1.5
This fixes the regression since 1.5 (cherry picked from commit c70a5bc)
This fixes the regression since 1.5, but not the slowdown due to removing
mutable
(which exists in multiple versions).