diff --git a/Compiler/src/abstractinterpretation.jl b/Compiler/src/abstractinterpretation.jl index 6b409f057eadf..208757be3ba37 100644 --- a/Compiler/src/abstractinterpretation.jl +++ b/Compiler/src/abstractinterpretation.jl @@ -872,11 +872,12 @@ function abstract_call_method_with_const_args(interp::AbstractInterpreter, concrete_eval_result = nothing if eligibility === :concrete_eval concrete_eval_result = concrete_eval_call(interp, f, result, arginfo, sv, invokecall) - # if we don't inline the result of this concrete evaluation, - # give const-prop' a chance to inline a better method body - if !may_optimize(interp) || ( - may_inline_concrete_result(concrete_eval_result.const_result::ConcreteResult) || - concrete_eval_result.rt === Bottom) # unless this call deterministically throws and thus is non-inlineable + if (concrete_eval_result !== nothing && # allow external abstract interpreters to disable concrete evaluation ad-hoc + # if we don't inline the result of this concrete evaluation, + # give const-prop' a chance to inline a better method body + (!may_optimize(interp) || + may_inline_concrete_result(concrete_eval_result.const_result::ConcreteResult) || + concrete_eval_result.rt === Bottom)) # unless this call deterministically throws and thus is non-inlineable return concrete_eval_result end # TODO allow semi-concrete interp for this call?