-
-
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
RFC: Avoid over-pessimization in apply_type_tfunc #27150
Conversation
Hm, LibGit2/libgit2 segfaults on 32bit Circle and Travis and hangs on FreeBSD, so likely related. Presumable, I now produce a |
Works locally with a 32bit build. Any ideas? |
base/compiler/tfuncs.jl
Outdated
if !isType(ai) | ||
return Any | ||
if !isa(ai, Type) || ai <: Type || Type <: ai |
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.
typeintersect(ai, Type) != Union{}
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.
Good catch!
base/compiler/tfuncs.jl
Outdated
if !isa(ai.val, Type) | ||
return Union{} | ||
end | ||
else |
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.
Checking explicitly for if isa TypeVar might be necessary (And PartialTypeVar)
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.
You mean ai.val
could be a TypeVar
and we shouldn't return Union{}
then?
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.
yes. or ai
could be a PartialTypeVar
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.
ai
being a PartialTypeVar
should be handled below. Do you mean ai.val
?
Though slightly different, LibGit2 failures recently popped up in #26997 as well. Best! |
2c5e9c1
to
a3f4331
Compare
base/compiler/tfuncs.jl
Outdated
if isa(ai, Const) | ||
if !isa(ai.val, Type) | ||
if isa(ai.val, TypeVar) || isa(ai.val, PartialTypeVar) | ||
return hasnonType = true |
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.
Did you mean like so, @vtjnash?
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.
Bump. I'm still not sure you meant this. A Const
PartialTypeVar
looks a bit funny here to me.
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.
isa(ai.val, PartialTypeVar)
can return Union{}
. But ai
itself can be a PartialTypeVar
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.
Alright, then I've apparently misinterpreted your earlier remark. The isa(ai, PartialTypeVar)
case is already handled below (in the !isType(ai)
and !isa(ai, Type)
branch).
AV 32bit got far but timed out, 64bit failed for a reason I don't really understand. Why did FreeBSD not run? Anyway, the LibGit2/libgit2 segfaults did not happen again. |
50a3a3e
to
e6ef253
Compare
Oh man, CI really doesn't like this one. AV timed out, an occasional libgit2 failure, and the rest
or |
e6ef253
to
52b0368
Compare
Oh, rebasing this led to an all-green CI! As a consequence, I'm unsure whether I'll ever dare touching this again. So...good to go? |
I would give one of @JeffBezanson, @Keno or @vtjnash 24 hours to comment and then merge |
Ooo! Requesting a review from @nanosoldier, fancy. |
Fancy indeed. But apparently, doesn't trigger him, so @nanosoldier |
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan |
I'm inclined to declare regressions as well as improvements there noise and will merge soonish unless anyone objects. |
Ref. #25861 (comment).