@@ -81,7 +81,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
81
81
splitsigs = switchtupleunion (sig)
82
82
for sig_n in splitsigs
83
83
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
85
85
this_argtypes = isa (matches, MethodMatches) ? argtypes : matches. applicable_argtypes[i]
86
86
this_arginfo = ArgInfo (fargs, this_argtypes)
87
87
const_call_result = abstract_call_method_with_const_args (interp,
@@ -90,14 +90,14 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
90
90
if const_call_result != = nothing
91
91
if const_call_result. rt ⊑ ₚ rt
92
92
rt = const_call_result. rt
93
- (; effects, const_result, edge ) = const_call_result
93
+ (; effects, const_result) = const_call_result
94
94
elseif is_better_effects (const_call_result. effects, effects)
95
- (; effects, const_result, edge ) = const_call_result
95
+ (; effects, const_result) = const_call_result
96
96
else
97
97
add_remark! (interp, sv, " [constprop] Discarded because the result was wider than inference" )
98
98
end
99
99
if const_call_result. exct ⋤ exct
100
- (; exct, const_result, edge ) = const_call_result
100
+ (; exct, const_result) = const_call_result
101
101
else
102
102
add_remark! (interp, sv, " [constprop] Discarded exception type because result was wider than inference" )
103
103
end
@@ -119,7 +119,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
119
119
this_rt = widenwrappedconditional (this_rt)
120
120
else
121
121
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
123
123
this_conditional = ignorelimited (rt)
124
124
this_rt = widenwrappedconditional (rt)
125
125
this_exct = exct
@@ -143,17 +143,17 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
143
143
# e.g. in cases when there are cycles but cached result is still accurate
144
144
this_conditional = this_const_conditional
145
145
this_rt = this_const_rt
146
- (; effects, const_result, edge ) = const_call_result
146
+ (; effects, const_result) = const_call_result
147
147
elseif is_better_effects (const_call_result. effects, effects)
148
- (; effects, const_result, edge ) = const_call_result
148
+ (; effects, const_result) = const_call_result
149
149
else
150
150
add_remark! (interp, sv, " [constprop] Discarded because the result was wider than inference" )
151
151
end
152
152
# Treat the exception type separately. Currently, constprop often cannot determine the exception type
153
153
# because consistent-cy does not apply to exceptions.
154
154
if const_call_result. exct ⋤ this_exct
155
155
this_exct = const_call_result. exct
156
- (; const_result, edge ) = const_call_result
156
+ (; const_result) = const_call_result
157
157
else
158
158
add_remark! (interp, sv, " [constprop] Discarded exception type because result was wider than inference" )
159
159
end
@@ -849,13 +849,11 @@ struct ConstCallResults
849
849
exct:: Any
850
850
const_result:: ConstResult
851
851
effects:: Effects
852
- edge:: MethodInstance
853
852
function ConstCallResults (
854
853
@nospecialize (rt), @nospecialize (exct),
855
854
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)
859
857
end
860
858
end
861
859
@@ -1007,9 +1005,9 @@ function concrete_eval_call(interp::AbstractInterpreter,
1007
1005
catch e
1008
1006
# The evaluation threw. By :consistent-cy, we're guaranteed this would have happened at runtime.
1009
1007
# 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)
1011
1009
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)
1013
1011
end
1014
1012
1015
1013
# check if there is a cycle and duplicated inference of `mi`
@@ -1274,7 +1272,7 @@ function semi_concrete_eval_call(interp::AbstractInterpreter,
1274
1272
effects = Effects (effects; noub= ALWAYS_TRUE)
1275
1273
end
1276
1274
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)
1278
1276
end
1279
1277
end
1280
1278
end
@@ -1283,7 +1281,7 @@ end
1283
1281
1284
1282
const_prop_result (inf_result:: InferenceResult ) =
1285
1283
ConstCallResults (inf_result. result, inf_result. exc_result, ConstPropResult (inf_result),
1286
- inf_result. ipo_effects, inf_result . linfo )
1284
+ inf_result. ipo_effects)
1287
1285
1288
1286
# return cached result of constant analysis
1289
1287
return_cached_result (:: AbstractInterpreter , inf_result:: InferenceResult , :: AbsIntState ) =
@@ -2114,7 +2112,7 @@ function abstract_invoke(interp::AbstractInterpreter, arginfo::ArgInfo, si::Stmt
2114
2112
tienv = ccall (:jl_type_intersection_with_env , Any, (Any, Any), nargtype, method. sig):: SimpleVector
2115
2113
ti = tienv[1 ]; env = tienv[2 ]:: SimpleVector
2116
2114
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
2118
2116
match = MethodMatch (ti, env, method, argtype <: method.sig )
2119
2117
res = nothing
2120
2118
sig = match. spec_types
@@ -2136,10 +2134,10 @@ function abstract_invoke(interp::AbstractInterpreter, arginfo::ArgInfo, si::Stmt
2136
2134
const_result = volatile_inf_result
2137
2135
if const_call_result != = nothing
2138
2136
if const_call_result. rt ⊑ rt
2139
- (; rt, effects, const_result, edge ) = const_call_result
2137
+ (; rt, effects, const_result) = const_call_result
2140
2138
end
2141
2139
if const_call_result. exct ⋤ exct
2142
- (; exct, const_result, edge ) = const_call_result
2140
+ (; exct, const_result) = const_call_result
2143
2141
end
2144
2142
end
2145
2143
rt = from_interprocedural! (interp, rt, sv, arginfo, sig)
@@ -2323,20 +2321,20 @@ function abstract_call_opaque_closure(interp::AbstractInterpreter,
2323
2321
hasintersect (sig, ocsig) || return CallMeta (Union{}, Union{MethodError,TypeError}, EFFECTS_THROWS, NoCallInfo ())
2324
2322
ocmethod = closure. source:: Method
2325
2323
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
2327
2325
match = MethodMatch (sig, Core. svec (), ocmethod, sig <: ocsig )
2328
2326
𝕃ₚ = ipo_lattice (interp)
2329
2327
⊑ , ⋤ , ⊔ = partialorder (𝕃ₚ), strictneqpartialorder (𝕃ₚ), join (𝕃ₚ)
2330
2328
const_result = volatile_inf_result
2331
2329
if ! result. edgecycle
2332
2330
const_call_result = abstract_call_method_with_const_args (interp, result,
2333
- nothing , arginfo, si, match, sv)
2331
+ #= f =# nothing , arginfo, si, match, sv)
2334
2332
if const_call_result != = nothing
2335
2333
if const_call_result. rt ⊑ rt
2336
- (; rt, effects, const_result, edge ) = const_call_result
2334
+ (; rt, effects, const_result) = const_call_result
2337
2335
end
2338
2336
if const_call_result. exct ⋤ exct
2339
- (; exct, const_result, edge ) = const_call_result
2337
+ (; exct, const_result) = const_call_result
2340
2338
end
2341
2339
end
2342
2340
end
0 commit comments