Skip to content

Commit

Permalink
inference: complete the inference even for recursive cycles (#56551)
Browse files Browse the repository at this point in the history
We care more and more now that our inference graph exactly matches the
callgraph, even in cases like this where we can easily prove that the
inference graph is simpler than the full callgraph. However, given when
the optimizer runs, it expects this information to be available and
valid as soon as the cycles are completed.
  • Loading branch information
vtjnash authored Nov 14, 2024
1 parent a32dba5 commit cf36497
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions Compiler/src/abstractinterpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -583,14 +583,6 @@ function abstract_call_method(interp::AbstractInterpreter,
if infmi.specTypes::Type == sig::Type
# avoid widening when detecting self-recursion
# TODO: merge call cycle and return right away
if call_result_unused(si)
add_remark!(interp, sv, RECURSION_UNUSED_MSG)
# since we don't use the result (typically),
# we have a self-cycle in the call-graph, but not in the inference graph (typically):
# break this edge now (before we record it) by returning early
# (non-typically, this means that we lose the ability to detect a guaranteed StackOverflow in some cases)
return Future(MethodCallResult(Any, Any, Effects(), nothing, true, true))
end
topmost = nothing
edgecycle = true
break
Expand Down

0 comments on commit cf36497

Please sign in to comment.