Skip to content

Commit ea5bce5

Browse files
committed
inference: remove hand-written heuristics
These should now be covered by the improved recursion detector.
1 parent 888d940 commit ea5bce5

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

base/inference.jl

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,15 +1770,7 @@ function abstract_call_method(method::Method, @nospecialize(f), @nospecialize(si
17701770
sigtuple = unwrap_unionall(sig)::DataType
17711771

17721772
tm = _topmod(sv)
1773-
if (# promote_typeof signature may be used with many arguments
1774-
!istopfunction(tm, f, :promote_typeof)
1775-
# assume getindex methods aren't directly recursive, since wrappers like ReshapedArrays won't look like it here
1776-
# should still manage to detect recursive growth either via other intermediate methods or actual type-equal signature recursion
1777-
&& !istopfunction(tm, f, :getindex)
1778-
&& !istopfunction(tm, f, :setindex!)
1779-
# the construct-to-convert method is a bottleneck in inference,
1780-
# so just assume that recursion will get prevented at some other point
1781-
&& !(method.sig == Tuple{Type, Any}))
1773+
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
17821774
# otherwise: limit argument type tuple growth of all other functions
17831775
msig = unwrap_unionall(method.sig)
17841776
lsig = length(msig.parameters)

0 commit comments

Comments
 (0)