Skip to content
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

Merged
merged 1 commit into from
Jan 7, 2021

Conversation

JeffBezanson
Copy link
Member

This fixes the regression since 1.5, but not the slowdown due to removing mutable (which exists in multiple versions).

@JeffBezanson JeffBezanson added compiler:optimizer Optimization passes (mostly in base/compiler/ssair/) backport 1.6 Change should be backported to release-1.6 labels Jan 5, 2021
if n == -1
n = length(t.parameters)
elseif n != length(t.parameters)
return u
Copy link
Member

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])
Copy link
Member

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 JeffBezanson merged commit c70a5bc into master Jan 7, 2021
@JeffBezanson JeffBezanson deleted the jb/fix38936 branch January 7, 2021 16:51
@clarkevans
Copy link
Member

@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).

KristofferC pushed a commit that referenced this pull request Jan 8, 2021
This fixes the regression since 1.5

(cherry picked from commit c70a5bc)
@KristofferC KristofferC removed the backport 1.6 Change should be backported to release-1.6 label Jan 8, 2021
staticfloat pushed a commit that referenced this pull request Jan 15, 2021
This fixes the regression since 1.5

(cherry picked from commit c70a5bc)
ElOceanografo pushed a commit to ElOceanografo/julia that referenced this pull request May 4, 2021
staticfloat pushed a commit that referenced this pull request Dec 23, 2022
This fixes the regression since 1.5

(cherry picked from commit c70a5bc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:optimizer Optimization passes (mostly in base/compiler/ssair/)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants