@@ -136,9 +136,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
136
136
end
137
137
tristate_merge! (sv, effects)
138
138
push! (const_results, const_result)
139
- if const_result != = nothing
140
- any_const_result = true
141
- end
139
+ any_const_result |= const_result != = nothing
142
140
this_rt = tmerge (this_rt, rt)
143
141
if bail_out_call (interp, this_rt, sv)
144
142
break
@@ -187,9 +185,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
187
185
end
188
186
tristate_merge! (sv, effects)
189
187
push! (const_results, const_result)
190
- if const_result != = nothing
191
- any_const_result = true
192
- end
188
+ any_const_result |= const_result != = nothing
193
189
end
194
190
@assert ! (this_conditional isa Conditional) " invalid lattice element returned from inter-procedural context"
195
191
seen += 1
@@ -704,12 +700,12 @@ function pure_eval_call(interp::AbstractInterpreter,
704
700
end
705
701
function _pure_eval_call (@nospecialize (f), arginfo:: ArgInfo )
706
702
args = collect_const_args (arginfo)
707
- try
708
- value = Core. _apply_pure (f, args)
709
- return Const (value)
703
+ value = try
704
+ Core. _apply_pure (f, args)
710
705
catch
711
706
return nothing
712
707
end
708
+ return Const (value)
713
709
end
714
710
715
711
function concrete_eval_eligible (interp:: AbstractInterpreter ,
@@ -743,17 +739,18 @@ function concrete_eval_call(interp::AbstractInterpreter,
743
739
@nospecialize (f), result:: MethodCallResult , arginfo:: ArgInfo , sv:: InferenceState )
744
740
concrete_eval_eligible (interp, f, result, arginfo, sv) || return nothing
745
741
args = collect_const_args (arginfo)
746
- try
747
- value = Core. _call_in_world_total (get_world_counter (interp), f, args... )
748
- if is_inlineable_constant (value) || call_result_unused (sv)
749
- # If the constant is not inlineable, still do the const-prop, since the
750
- # code that led to the creation of the Const may be inlineable in the same
751
- # circumstance and may be optimizable.
752
- return ConstCallResults (Const (value), ConstResult (result. edge, value), EFFECTS_TOTAL)
753
- end
742
+ world = get_world_counter (interp)
743
+ value = try
744
+ Core. _call_in_world_total (world, f, args... )
754
745
catch
755
746
# The evaulation threw. By :consistent-cy, we're guaranteed this would have happened at runtime
756
- return ConstCallResults (Union{}, ConstResult (result. edge), result. edge_effects)
747
+ return ConstCallResults (Union{}, ConstResult (result. edge, result. edge_effects), result. edge_effects)
748
+ end
749
+ if is_inlineable_constant (value) || call_result_unused (sv)
750
+ # If the constant is not inlineable, still do the const-prop, since the
751
+ # code that led to the creation of the Const may be inlineable in the same
752
+ # circumstance and may be optimizable.
753
+ return ConstCallResults (Const (value), ConstResult (result. edge, EFFECTS_TOTAL, value), EFFECTS_TOTAL)
757
754
end
758
755
return nothing
759
756
end
0 commit comments