Skip to content

Commit 9f7a7e2

Browse files
committed
Don't attempt concrete eval if there's no information to be gained
If the effects are already maximized and the rt is already Const, there is nothing concrete evaluation could possibly tell us that we don't already know - just bail early in that case to save some inference time.
1 parent f7dea04 commit 9f7a7e2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

base/compiler/abstractinterpretation.jl

+6
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,12 @@ function abstract_call_method_with_const_args(interp::AbstractInterpreter, resul
880880
if !const_prop_enabled(interp, sv, match)
881881
return nothing
882882
end
883+
if is_total(result.effects)
884+
if isa(result.rt, Const) || call_result_unused(sv)
885+
# There is no more information to be gained here. Bail out early.
886+
return nothing
887+
end
888+
end
883889
res = concrete_eval_call(interp, f, result, arginfo, sv)
884890
if isa(res, ConstCallResults)
885891
add_backedge!(res.const_result.mi, sv, invoketypes)

0 commit comments

Comments
 (0)