Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions base/compiler/abstractinterpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1257,8 +1257,15 @@ function abstract_eval_ssavalue(s::SSAValue, src::CodeInfo)
return typ
end

const __collect_inference_callees__ = fill(false) # Singleton Unary Array since Ref isn't available yet
#const __inference_callees__ = Vector{MethodInstance}()

# make as much progress on `frame` as possible (without handling cycles)
function typeinf_local(interp::AbstractInterpreter, frame::InferenceState)
#if __collect_inference_callees__[]
# push!(__inference_callees__, frame.linfo)
#end

@assert !frame.inferred
frame.dont_work_on_me = true # mark that this function is currently on the stack
W = frame.ip
Expand Down
7 changes: 7 additions & 0 deletions base/compiler/typeinfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,8 @@ function resolve_call_cycle!(interp::AbstractInterpreter, linfo::MethodInstance,
return false
end

const __inference_callee_edges4__ = Vector{Tuple{MethodInstance, Vector{Tuple{MethodInstance,MethodInstance}}}}()

# compute (and cache) an inferred AST and return the current best estimate of the result type
function typeinf_edge(interp::AbstractInterpreter, method::Method, @nospecialize(atypes), sparams::SimpleVector, caller::InferenceState)
mi = specialize_method(method, atypes, sparams)::MethodInstance
Expand Down Expand Up @@ -533,6 +535,11 @@ function typeinf_edge(interp::AbstractInterpreter, method::Method, @nospecialize
if caller.cached || caller.limited # don't involve uncached functions in cycle resolution
frame.parent = caller
end
if __collect_inference_callees__[]
#Core.println("edge!")
#Core.println(__inference_callee_edges4__)
push!(__inference_callee_edges4__[end][2], (caller.linfo, frame.linfo))
end
typeinf(interp, frame)
update_valid_age!(frame, caller)
return widenconst_bestguess(frame.bestguess), frame.inferred ? mi : nothing
Expand Down