-
-
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
a few compiler improvements #36176
a few compiler improvements #36176
Conversation
66eea42
to
2521b73
Compare
Worth pointing out that we might not even need those generated functions if we fix #9080. |
- improve fieldtype_nothrow for vararg tuple types - remove UnionAll construction code from tuple_type_head - add specializations to avoid some common generated functions
2521b73
to
3d99561
Compare
return false | ||
# If we don't know the exact type, the length of the tuple will be determined | ||
# at runtime and we can't say anything. | ||
return exact |
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.
This still doesn't seem right. fieldtype(NTuple{10, T} where T, 20)
certainly does error.
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.
That doesn't contain a Vararg
but I guess it might in the future, so I can add 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.
Fair enough. I guess we didn't change this yet.
@@ -776,6 +775,20 @@ end | |||
end | |||
end | |||
|
|||
# Always index with the exactly indices provided. | |||
@generated function _unsafe_getindex!(dest::AbstractArray, src::AbstractArray, I::Vararg{Union{Real, AbstractArray}, N}) where N | |||
_generate_unsafe_getindex!_body(N) |
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.
Nice!
- improve fieldtype_nothrow for vararg tuple types - remove UnionAll construction code from tuple_type_head - add specializations to avoid some common generated functions
This shaves about 0.5 sec off the TTFP. The first two items fix some disastrous code for vararg tuple conversion: