@@ -96,15 +96,11 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
9696 all_effects = EFFECTS_TOTAL
9797 if ! matches. nonoverlayed
9898 # currently we don't have a good way to execute the overlayed method definition,
99- # so we should give up pure/ concrete eval when any of the matched methods is overlayed
99+ # so we should give up concrete eval when any of the matched methods is overlayed
100100 f = nothing
101101 all_effects = Effects (all_effects; nonoverlayed= false )
102102 end
103103
104- # try pure-evaluation
105- val = pure_eval_call (interp, f, applicable, arginfo)
106- val != = nothing && return CallMeta (val, all_effects, MethodResultPure (info)) # TODO : add some sort of edge(s)
107-
108104 𝕃ₚ = ipo_lattice (interp)
109105 for i in 1 : napplicable
110106 match = applicable[i]:: MethodMatch
@@ -788,40 +784,6 @@ struct MethodCallResult
788784 end
789785end
790786
791- function pure_eval_eligible (interp:: AbstractInterpreter ,
792- @nospecialize (f), applicable:: Vector{Any} , arginfo:: ArgInfo )
793- # XXX we need to check that this pure function doesn't call any overlayed method
794- return f != = nothing &&
795- length (applicable) == 1 &&
796- is_method_pure (applicable[1 ]:: MethodMatch ) &&
797- is_all_const_arg (arginfo, #= start=# 2 )
798- end
799-
800- function is_method_pure (method:: Method , @nospecialize (sig), sparams:: SimpleVector )
801- if isdefined (method, :generator )
802- method. generator. expand_early || return false
803- mi = specialize_method (method, sig, sparams)
804- isa (mi, MethodInstance) || return false
805- staged = get_staged (mi)
806- (staged isa CodeInfo && (staged:: CodeInfo ). pure) || return false
807- return true
808- end
809- return method. pure
810- end
811- is_method_pure (match:: MethodMatch ) = is_method_pure (match. method, match. spec_types, match. sparams)
812-
813- function pure_eval_call (interp:: AbstractInterpreter ,
814- @nospecialize (f), applicable:: Vector{Any} , arginfo:: ArgInfo )
815- pure_eval_eligible (interp, f, applicable, arginfo) || return nothing
816- args = collect_const_args (arginfo, #= start=# 2 )
817- value = try
818- Core. _apply_pure (f, args)
819- catch
820- return nothing
821- end
822- return Const (value)
823- end
824-
825787# - true: eligible for concrete evaluation
826788# - false: eligible for semi-concrete evaluation
827789# - nothing: not eligible for either of it
0 commit comments