Skip to content

Commit fe8d042

Browse files
committed
remove no longer needed edge variables
1 parent d22e853 commit fe8d042

File tree

1 file changed

+21
-23
lines changed

1 file changed

+21
-23
lines changed

base/compiler/abstractinterpretation.jl

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
8181
splitsigs = switchtupleunion(sig)
8282
for sig_n in splitsigs
8383
result = abstract_call_method(interp, method, sig_n, svec(), multiple_matches, si, sv)
84-
(; rt, exct, edge, effects, volatile_inf_result) = result
84+
(; rt, exct, effects, volatile_inf_result) = result
8585
this_argtypes = isa(matches, MethodMatches) ? argtypes : matches.applicable_argtypes[i]
8686
this_arginfo = ArgInfo(fargs, this_argtypes)
8787
const_call_result = abstract_call_method_with_const_args(interp,
@@ -90,14 +90,14 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
9090
if const_call_result !== nothing
9191
if const_call_result.rt ₚ rt
9292
rt = const_call_result.rt
93-
(; effects, const_result, edge) = const_call_result
93+
(; effects, const_result) = const_call_result
9494
elseif is_better_effects(const_call_result.effects, effects)
95-
(; effects, const_result, edge) = const_call_result
95+
(; effects, const_result) = const_call_result
9696
else
9797
add_remark!(interp, sv, "[constprop] Discarded because the result was wider than inference")
9898
end
9999
if const_call_result.exct exct
100-
(; exct, const_result, edge) = const_call_result
100+
(; exct, const_result) = const_call_result
101101
else
102102
add_remark!(interp, sv, "[constprop] Discarded exception type because result was wider than inference")
103103
end
@@ -119,7 +119,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
119119
this_rt = widenwrappedconditional(this_rt)
120120
else
121121
result = abstract_call_method(interp, method, sig, match.sparams, multiple_matches, si, sv)
122-
(; rt, exct, edge, effects, volatile_inf_result) = result
122+
(; rt, exct, effects, volatile_inf_result) = result
123123
this_conditional = ignorelimited(rt)
124124
this_rt = widenwrappedconditional(rt)
125125
this_exct = exct
@@ -143,17 +143,17 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
143143
# e.g. in cases when there are cycles but cached result is still accurate
144144
this_conditional = this_const_conditional
145145
this_rt = this_const_rt
146-
(; effects, const_result, edge) = const_call_result
146+
(; effects, const_result) = const_call_result
147147
elseif is_better_effects(const_call_result.effects, effects)
148-
(; effects, const_result, edge) = const_call_result
148+
(; effects, const_result) = const_call_result
149149
else
150150
add_remark!(interp, sv, "[constprop] Discarded because the result was wider than inference")
151151
end
152152
# Treat the exception type separately. Currently, constprop often cannot determine the exception type
153153
# because consistent-cy does not apply to exceptions.
154154
if const_call_result.exct this_exct
155155
this_exct = const_call_result.exct
156-
(; const_result, edge) = const_call_result
156+
(; const_result) = const_call_result
157157
else
158158
add_remark!(interp, sv, "[constprop] Discarded exception type because result was wider than inference")
159159
end
@@ -849,13 +849,11 @@ struct ConstCallResults
849849
exct::Any
850850
const_result::ConstResult
851851
effects::Effects
852-
edge::MethodInstance
853852
function ConstCallResults(
854853
@nospecialize(rt), @nospecialize(exct),
855854
const_result::ConstResult,
856-
effects::Effects,
857-
edge::MethodInstance)
858-
return new(rt, exct, const_result, effects, edge)
855+
effects::Effects)
856+
return new(rt, exct, const_result, effects)
859857
end
860858
end
861859

@@ -1007,9 +1005,9 @@ function concrete_eval_call(interp::AbstractInterpreter,
10071005
catch e
10081006
# The evaluation threw. By :consistent-cy, we're guaranteed this would have happened at runtime.
10091007
# Howevever, at present, :consistency does not mandate the type of the exception
1010-
return ConstCallResults(Bottom, Any, ConcreteResult(edge, result.effects), result.effects, edge)
1008+
return ConstCallResults(Bottom, Any, ConcreteResult(edge, result.effects), result.effects)
10111009
end
1012-
return ConstCallResults(Const(value), Union{}, ConcreteResult(edge, EFFECTS_TOTAL, value), EFFECTS_TOTAL, edge)
1010+
return ConstCallResults(Const(value), Union{}, ConcreteResult(edge, EFFECTS_TOTAL, value), EFFECTS_TOTAL)
10131011
end
10141012

10151013
# check if there is a cycle and duplicated inference of `mi`
@@ -1274,7 +1272,7 @@ function semi_concrete_eval_call(interp::AbstractInterpreter,
12741272
effects = Effects(effects; noub=ALWAYS_TRUE)
12751273
end
12761274
exct = refine_exception_type(result.exct, effects)
1277-
return ConstCallResults(rt, exct, SemiConcreteResult(mi, ir, effects), effects, mi)
1275+
return ConstCallResults(rt, exct, SemiConcreteResult(mi, ir, effects), effects)
12781276
end
12791277
end
12801278
end
@@ -1283,7 +1281,7 @@ end
12831281

12841282
const_prop_result(inf_result::InferenceResult) =
12851283
ConstCallResults(inf_result.result, inf_result.exc_result, ConstPropResult(inf_result),
1286-
inf_result.ipo_effects, inf_result.linfo)
1284+
inf_result.ipo_effects)
12871285

12881286
# return cached result of constant analysis
12891287
return_cached_result(::AbstractInterpreter, inf_result::InferenceResult, ::AbsIntState) =
@@ -2114,7 +2112,7 @@ function abstract_invoke(interp::AbstractInterpreter, arginfo::ArgInfo, si::Stmt
21142112
tienv = ccall(:jl_type_intersection_with_env, Any, (Any, Any), nargtype, method.sig)::SimpleVector
21152113
ti = tienv[1]; env = tienv[2]::SimpleVector
21162114
result = abstract_call_method(interp, method, ti, env, false, si, sv)
2117-
(; rt, exct, edge, effects, volatile_inf_result) = result
2115+
(; rt, exct, effects, volatile_inf_result) = result
21182116
match = MethodMatch(ti, env, method, argtype <: method.sig)
21192117
res = nothing
21202118
sig = match.spec_types
@@ -2136,10 +2134,10 @@ function abstract_invoke(interp::AbstractInterpreter, arginfo::ArgInfo, si::Stmt
21362134
const_result = volatile_inf_result
21372135
if const_call_result !== nothing
21382136
if const_call_result.rt rt
2139-
(; rt, effects, const_result, edge) = const_call_result
2137+
(; rt, effects, const_result) = const_call_result
21402138
end
21412139
if const_call_result.exct exct
2142-
(; exct, const_result, edge) = const_call_result
2140+
(; exct, const_result) = const_call_result
21432141
end
21442142
end
21452143
rt = from_interprocedural!(interp, rt, sv, arginfo, sig)
@@ -2323,20 +2321,20 @@ function abstract_call_opaque_closure(interp::AbstractInterpreter,
23232321
hasintersect(sig, ocsig) || return CallMeta(Union{}, Union{MethodError,TypeError}, EFFECTS_THROWS, NoCallInfo())
23242322
ocmethod = closure.source::Method
23252323
result = abstract_call_method(interp, ocmethod, sig, Core.svec(), false, si, sv)
2326-
(; rt, exct, edge, effects, volatile_inf_result) = result
2324+
(; rt, exct, effects, volatile_inf_result) = result
23272325
match = MethodMatch(sig, Core.svec(), ocmethod, sig <: ocsig)
23282326
𝕃ₚ = ipo_lattice(interp)
23292327
, , = partialorder(𝕃ₚ), strictneqpartialorder(𝕃ₚ), join(𝕃ₚ)
23302328
const_result = volatile_inf_result
23312329
if !result.edgecycle
23322330
const_call_result = abstract_call_method_with_const_args(interp, result,
2333-
nothing, arginfo, si, match, sv)
2331+
#=f=#nothing, arginfo, si, match, sv)
23342332
if const_call_result !== nothing
23352333
if const_call_result.rt rt
2336-
(; rt, effects, const_result, edge) = const_call_result
2334+
(; rt, effects, const_result) = const_call_result
23372335
end
23382336
if const_call_result.exct exct
2339-
(; exct, const_result, edge) = const_call_result
2337+
(; exct, const_result) = const_call_result
23402338
end
23412339
end
23422340
end

0 commit comments

Comments
 (0)