-
-
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
inference: fix stupdate for Conditional after slot re-assignment #25602
Conversation
@@ -28,11 +28,11 @@ end | |||
# end | |||
# ``` | |||
mutable struct Conditional | |||
var::Union{Slot,SSAValue} | |||
var::Slot |
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.
Why can't this apply to SSAValues?
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.
Not worth the compile-time performance cost, since it'll never generate better results (on our current syntax).
base/compiler/typelattice.jl
Outdated
if isa(newtype, VarState) | ||
newtypetyp = newtype.typ | ||
if isa(newtypetyp, Conditional) && slot_id(newtypetyp.var) == changeid | ||
newst[i] = VarState(Bool, newtype.undef) |
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.
Update to Const(...)
if it's a conditional of the matching form?
test/compiler/compiler.jl
Outdated
end | ||
@test Base.return_types(h25579, (Base.RefValue{Union{Nothing, Int}},)) == | ||
Any[Union{Type{Float64}, Type{Int64}, Type{Nothing}}] |
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.
Needs to be adjusted for 32-bit platforms. If I had a dime for every time I've done that...
We were neglecting to clear Conditional objects upon assignment to their attached slot (which invalidates their knowledge of the contents of that slot) fixes #25579
We were neglecting to clear Conditional objects upon assignment to their attached slot
(which invalidates their knowledge of the contents of that slot)
fixes #25579