Skip to content

Commit 6f64fd6

Browse files
committed
remove no longer needed edge variables
1 parent a674c1c commit 6f64fd6

File tree

1 file changed

+17
-20
lines changed

1 file changed

+17
-20
lines changed

base/compiler/abstractinterpretation.jl

+17-20
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
9494
#end
9595
mresult = abstract_call_method(interp, method, sig, match.sparams, multiple_matches, si, sv)::Future
9696
function handle1(interp, sv)
97-
local (; rt, exct, edge, effects, volatile_inf_result) = mresult[]
97+
local (; rt, exct, effects, volatile_inf_result) = mresult[]
9898
this_conditional = ignorelimited(rt)
9999
this_rt = widenwrappedconditional(rt)
100100
this_exct = exct
@@ -118,17 +118,17 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
118118
# e.g. in cases when there are cycles but cached result is still accurate
119119
this_conditional = this_const_conditional
120120
this_rt = this_const_rt
121-
(; effects, const_result, edge) = const_call_result
121+
(; effects, const_result) = const_call_result
122122
elseif is_better_effects(const_call_result.effects, effects)
123-
(; effects, const_result, edge) = const_call_result
123+
(; effects, const_result) = const_call_result
124124
else
125125
add_remark!(interp, sv, "[constprop] Discarded because the result was wider than inference")
126126
end
127127
# Treat the exception type separately. Currently, constprop often cannot determine the exception type
128128
# because consistent-cy does not apply to exceptions.
129129
if const_call_result.exct this_exct
130130
this_exct = const_call_result.exct
131-
(; const_result, edge) = const_call_result
131+
(; const_result) = const_call_result
132132
else
133133
add_remark!(interp, sv, "[constprop] Discarded exception type because result was wider than inference")
134134
end
@@ -228,7 +228,6 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
228228
# and avoid keeping track of a more complex result type.
229229
rettype = Any
230230
end
231-
any_slot_refined = slotrefinements !== nothing
232231
if isa(sv, InferenceState)
233232
# TODO (#48913) implement a proper recursion handling for irinterp:
234233
# This works just because currently the `:terminate` condition guarantees that
@@ -814,13 +813,11 @@ struct ConstCallResults
814813
exct::Any
815814
const_result::ConstResult
816815
effects::Effects
817-
edge::MethodInstance
818816
function ConstCallResults(
819817
@nospecialize(rt), @nospecialize(exct),
820818
const_result::ConstResult,
821-
effects::Effects,
822-
edge::MethodInstance)
823-
return new(rt, exct, const_result, effects, edge)
819+
effects::Effects)
820+
return new(rt, exct, const_result, effects)
824821
end
825822
end
826823

@@ -972,9 +969,9 @@ function concrete_eval_call(interp::AbstractInterpreter,
972969
catch e
973970
# The evaluation threw. By :consistent-cy, we're guaranteed this would have happened at runtime.
974971
# Howevever, at present, :consistency does not mandate the type of the exception
975-
return ConstCallResults(Bottom, Any, ConcreteResult(edge, result.effects), result.effects, edge)
972+
return ConstCallResults(Bottom, Any, ConcreteResult(edge, result.effects), result.effects)
976973
end
977-
return ConstCallResults(Const(value), Union{}, ConcreteResult(edge, EFFECTS_TOTAL, value), EFFECTS_TOTAL, edge)
974+
return ConstCallResults(Const(value), Union{}, ConcreteResult(edge, EFFECTS_TOTAL, value), EFFECTS_TOTAL)
978975
end
979976

980977
# check if there is a cycle and duplicated inference of `mi`
@@ -1239,7 +1236,7 @@ function semi_concrete_eval_call(interp::AbstractInterpreter,
12391236
effects = Effects(effects; noub=ALWAYS_TRUE)
12401237
end
12411238
exct = refine_exception_type(result.exct, effects)
1242-
return ConstCallResults(rt, exct, SemiConcreteResult(mi, ir, effects, spec_info(irsv)), effects, mi)
1239+
return ConstCallResults(rt, exct, SemiConcreteResult(mi, ir, effects, spec_info(irsv)), effects)
12431240
end
12441241
end
12451242
end
@@ -1248,7 +1245,7 @@ end
12481245

12491246
const_prop_result(inf_result::InferenceResult) =
12501247
ConstCallResults(inf_result.result, inf_result.exc_result, ConstPropResult(inf_result),
1251-
inf_result.ipo_effects, inf_result.linfo)
1248+
inf_result.ipo_effects)
12521249

12531250
# return cached result of constant analysis
12541251
return_localcache_result(::AbstractInterpreter, inf_result::InferenceResult, ::AbsIntState) =
@@ -2186,7 +2183,7 @@ function abstract_invoke(interp::AbstractInterpreter, arginfo::ArgInfo, si::Stmt
21862183
mresult = abstract_call_method(interp, method, ti, env, false, si, sv)::Future
21872184
match = MethodMatch(ti, env, method, argtype <: method.sig)
21882185
return Future{CallMeta}(mresult, interp, sv) do result, interp, sv
2189-
(; rt, exct, edge, effects, volatile_inf_result) = result
2186+
(; rt, exct, effects, volatile_inf_result) = result
21902187
res = nothing
21912188
sig = match.spec_types
21922189
argtypes′ = invoke_rewrite(argtypes)
@@ -2207,10 +2204,10 @@ function abstract_invoke(interp::AbstractInterpreter, arginfo::ArgInfo, si::Stmt
22072204
const_result = volatile_inf_result
22082205
if const_call_result !== nothing
22092206
if const_call_result.rt rt
2210-
(; rt, effects, const_result, edge) = const_call_result
2207+
(; rt, effects, const_result) = const_call_result
22112208
end
22122209
if const_call_result.exct exct
2213-
(; exct, const_result, edge) = const_call_result
2210+
(; exct, const_result) = const_call_result
22142211
end
22152212
end
22162213
rt = from_interprocedural!(interp, rt, sv, arginfo, sig)
@@ -2410,19 +2407,19 @@ function abstract_call_opaque_closure(interp::AbstractInterpreter,
24102407
mresult = abstract_call_method(interp, ocmethod, sig, Core.svec(), false, si, sv)
24112408
ocsig_box = Core.Box(ocsig)
24122409
return Future{CallMeta}(mresult, interp, sv) do result, interp, sv
2413-
(; rt, exct, edge, effects, volatile_inf_result, edgecycle) = result
2410+
(; rt, exct, effects, volatile_inf_result, edgecycle) = result
24142411
𝕃ₚ = ipo_lattice(interp)
24152412
, , = partialorder(𝕃ₚ), strictneqpartialorder(𝕃ₚ), join(𝕃ₚ)
24162413
const_result = volatile_inf_result
24172414
if !edgecycle
24182415
const_call_result = abstract_call_method_with_const_args(interp, result,
2419-
nothing, arginfo, si, match, sv)
2416+
#=f=#nothing, arginfo, si, match, sv)
24202417
if const_call_result !== nothing
24212418
if const_call_result.rt rt
2422-
(; rt, effects, const_result, edge) = const_call_result
2419+
(; rt, effects, const_result) = const_call_result
24232420
end
24242421
if const_call_result.exct exct
2425-
(; exct, const_result, edge) = const_call_result
2422+
(; exct, const_result) = const_call_result
24262423
end
24272424
end
24282425
end

0 commit comments

Comments
 (0)