-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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: allocate CodeInstance with inference results ASAP #54709
Conversation
a117769
to
cb7c95d
Compare
Update the CodeInstance after optimizations with code (if possible), but construct it early so that there will be the option of using it for edges and invoke during optimizations, without problems with cycles.
cb7c95d
to
7c05e1a
Compare
7c05e1a
to
5cc5640
Compare
# we might have introduced a limit marker, but we should know it must be sv and other callers_in_cycle | ||
#@assert !isempty(sv.callers_in_cycle) | ||
# FIXME: this assert fails, appearing to indicate there is a bug in filtering this list earlier. | ||
# In particular (during doctests for example), during inference of | ||
# show(Base.IOContext{Base.GenericIOBuffer{Memory{UInt8}}}, Base.Multimedia.MIME{:var"text/plain"}, LinearAlgebra.BunchKaufman{Float64, Array{Float64, 2}, Array{Int64, 1}}) | ||
# we observed one of the ssavaluetypes here to be Core.Compiler.LimitedAccuracy(typ=Any, causes=Core.Compiler.IdSet(getproperty(LinearAlgebra.BunchKaufman{Float64, Array{Float64, 2}, Array{Int64, 1}}, Symbol))) |
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.
AFAIU, this assertion should be failing because of the removal of push!(frames, frame)
on L239, i.e. it fails when LimitedAccuracy
is introduced in cases of self-recursion. Was this an intentional change?
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.
The code at L239 seemed to have been making this accidentally pass and hiding this bug. In particular, there didn't seem to be self-recursion here (and LimitedAccuracy should not occur if there is self-recursion, typically)?
Update the CodeInstance after optimizations with the code (if possible), but construct it early so that there will be the option of using it for edges and invoke during optimizations, without problems with cycles.
@Keno the intent is that this will let us use CodeInstance as targets for
:invoke
calls, as discussed in https://hackmd.io/bpLnKm48TbWP_U_PGWgEVg. It complicates the life-cycle of a CodeInstance a little bit, so I don't think we have yet fully specified the thread-safety of this and which are valid transitions here (in general, it is only legal to narrow these properties or widen the worlds), but I think that is okay to postpone.