Skip to content

Commit a5a2db9

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

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

base/compiler/abstractinterpretation.jl

+15-17
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
@@ -814,13 +814,11 @@ struct ConstCallResults
814814
exct::Any
815815
const_result::ConstResult
816816
effects::Effects
817-
edge::MethodInstance
818817
function ConstCallResults(
819818
@nospecialize(rt), @nospecialize(exct),
820819
const_result::ConstResult,
821-
effects::Effects,
822-
edge::MethodInstance)
823-
return new(rt, exct, const_result, effects, edge)
820+
effects::Effects)
821+
return new(rt, exct, const_result, effects)
824822
end
825823
end
826824

@@ -972,9 +970,9 @@ function concrete_eval_call(interp::AbstractInterpreter,
972970
catch e
973971
# The evaluation threw. By :consistent-cy, we're guaranteed this would have happened at runtime.
974972
# Howevever, at present, :consistency does not mandate the type of the exception
975-
return ConstCallResults(Bottom, Any, ConcreteResult(edge, result.effects), result.effects, edge)
973+
return ConstCallResults(Bottom, Any, ConcreteResult(edge, result.effects), result.effects)
976974
end
977-
return ConstCallResults(Const(value), Union{}, ConcreteResult(edge, EFFECTS_TOTAL, value), EFFECTS_TOTAL, edge)
975+
return ConstCallResults(Const(value), Union{}, ConcreteResult(edge, EFFECTS_TOTAL, value), EFFECTS_TOTAL)
978976
end
979977

980978
# check if there is a cycle and duplicated inference of `mi`
@@ -1239,7 +1237,7 @@ function semi_concrete_eval_call(interp::AbstractInterpreter,
12391237
effects = Effects(effects; noub=ALWAYS_TRUE)
12401238
end
12411239
exct = refine_exception_type(result.exct, effects)
1242-
return ConstCallResults(rt, exct, SemiConcreteResult(mi, ir, effects, spec_info(irsv)), effects, mi)
1240+
return ConstCallResults(rt, exct, SemiConcreteResult(mi, ir, effects, spec_info(irsv)), effects)
12431241
end
12441242
end
12451243
end
@@ -1248,7 +1246,7 @@ end
12481246

12491247
const_prop_result(inf_result::InferenceResult) =
12501248
ConstCallResults(inf_result.result, inf_result.exc_result, ConstPropResult(inf_result),
1251-
inf_result.ipo_effects, inf_result.linfo)
1249+
inf_result.ipo_effects)
12521250

12531251
# return cached result of constant analysis
12541252
return_localcache_result(::AbstractInterpreter, inf_result::InferenceResult, ::AbsIntState) =
@@ -2207,10 +2205,10 @@ function abstract_invoke(interp::AbstractInterpreter, arginfo::ArgInfo, si::Stmt
22072205
const_result = volatile_inf_result
22082206
if const_call_result !== nothing
22092207
if const_call_result.rt rt
2210-
(; rt, effects, const_result, edge) = const_call_result
2208+
(; rt, effects, const_result) = const_call_result
22112209
end
22122210
if const_call_result.exct exct
2213-
(; exct, const_result, edge) = const_call_result
2211+
(; exct, const_result) = const_call_result
22142212
end
22152213
end
22162214
rt = from_interprocedural!(interp, rt, sv, arginfo, sig)
@@ -2410,7 +2408,7 @@ function abstract_call_opaque_closure(interp::AbstractInterpreter,
24102408
mresult = abstract_call_method(interp, ocmethod, sig, Core.svec(), false, si, sv)
24112409
ocsig_box = Core.Box(ocsig)
24122410
return Future{CallMeta}(mresult, interp, sv) do result, interp, sv
2413-
(; rt, exct, edge, effects, volatile_inf_result, edgecycle) = result
2411+
(; rt, exct, effects, volatile_inf_result, edgecycle) = result
24142412
𝕃ₚ = ipo_lattice(interp)
24152413
, , = partialorder(𝕃ₚ), strictneqpartialorder(𝕃ₚ), join(𝕃ₚ)
24162414
const_result = volatile_inf_result
@@ -2419,10 +2417,10 @@ function abstract_call_opaque_closure(interp::AbstractInterpreter,
24192417
nothing, arginfo, si, match, sv)
24202418
if const_call_result !== nothing
24212419
if const_call_result.rt rt
2422-
(; rt, effects, const_result, edge) = const_call_result
2420+
(; rt, effects, const_result) = const_call_result
24232421
end
24242422
if const_call_result.exct exct
2425-
(; exct, const_result, edge) = const_call_result
2423+
(; exct, const_result) = const_call_result
24262424
end
24272425
end
24282426
end

0 commit comments

Comments
 (0)