Skip to content

Commit

Permalink
inference: remove hand-written heuristics
Browse files Browse the repository at this point in the history
These should now be covered by the improved recursion detector.
  • Loading branch information
vtjnash committed Sep 28, 2017
1 parent 888d940 commit ea5bce5
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions base/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1770,15 +1770,7 @@ function abstract_call_method(method::Method, @nospecialize(f), @nospecialize(si
sigtuple = unwrap_unionall(sig)::DataType

tm = _topmod(sv)
if (# promote_typeof signature may be used with many arguments
!istopfunction(tm, f, :promote_typeof)
# assume getindex methods aren't directly recursive, since wrappers like ReshapedArrays won't look like it here
# should still manage to detect recursive growth either via other intermediate methods or actual type-equal signature recursion
&& !istopfunction(tm, f, :getindex)
&& !istopfunction(tm, f, :setindex!)
# the construct-to-convert method is a bottleneck in inference,
# so just assume that recursion will get prevented at some other point
&& !(method.sig == Tuple{Type, Any}))
if (!istopfunction(tm, f, :promote_typeof)) # promote_typeof signature may be used with many arguments, here we'll just assume it is defined non-recursively
# otherwise: limit argument type tuple growth of all other functions
msig = unwrap_unionall(method.sig)
lsig = length(msig.parameters)
Expand Down

0 comments on commit ea5bce5

Please sign in to comment.