@@ -267,6 +267,7 @@ mutable struct InferenceState
267
267
bb_vartables:: Vector{Union{Nothing,VarTable}} # nothing if not analyzed yet
268
268
bb_saw_latestworld:: Vector{Bool}
269
269
ssavaluetypes:: Vector{Any}
270
+ ssaflags:: Vector{UInt32}
270
271
edges:: Vector{Any}
271
272
stmt_info:: Vector{CallInfo}
272
273
@@ -343,6 +344,7 @@ mutable struct InferenceState
343
344
bb_vartable1[i] = VarState (argtyp, i > nargtypes)
344
345
end
345
346
src. ssavaluetypes = ssavaluetypes = Any[ NOT_FOUND for i = 1 : nssavalues ]
347
+ ssaflags = copy (src. ssaflags)
346
348
347
349
unreachable = BitSet ()
348
350
pclimitations = IdSet {InferenceState} ()
@@ -374,7 +376,7 @@ mutable struct InferenceState
374
376
375
377
this = new (
376
378
mi, WorldWithRange (world, valid_worlds), mod, sptypes, slottypes, src, cfg, spec_info,
377
- currbb, currpc, ip, handler_info, ssavalue_uses, bb_vartables, bb_saw_latestworld, ssavaluetypes, edges, stmt_info,
379
+ currbb, currpc, ip, handler_info, ssavalue_uses, bb_vartables, bb_saw_latestworld, ssavaluetypes, ssaflags, edges, stmt_info,
378
380
tasks, pclimitations, limitations, cycle_backedges, callstack, parentid, frameid, cycleid,
379
381
result, unreachable, bestguess, exc_bestguess, ipo_effects,
380
382
restrict_abstract_call_sites, cache_mode, insert_coverage,
@@ -1004,25 +1006,22 @@ function callers_in_cycle(sv::InferenceState)
1004
1006
end
1005
1007
callers_in_cycle (sv:: IRInterpretationState ) = AbsIntCycle (sv. callstack:: Vector{AbsIntState} , 0 , 0 )
1006
1008
1007
- get_curr_ssaflag (sv:: InferenceState ) = sv. src . ssaflags[sv. currpc]
1009
+ get_curr_ssaflag (sv:: InferenceState ) = sv. ssaflags[sv. currpc]
1008
1010
get_curr_ssaflag (sv:: IRInterpretationState ) = sv. ir. stmts[sv. curridx][:flag ]
1009
1011
1010
- has_curr_ssaflag (sv:: InferenceState , flag:: UInt32 ) = has_flag (sv. src . ssaflags[sv. currpc], flag)
1012
+ has_curr_ssaflag (sv:: InferenceState , flag:: UInt32 ) = has_flag (sv. ssaflags[sv. currpc], flag)
1011
1013
has_curr_ssaflag (sv:: IRInterpretationState , flag:: UInt32 ) = has_flag (sv. ir. stmts[sv. curridx][:flag ], flag)
1012
1014
1013
1015
function set_curr_ssaflag! (sv:: InferenceState , flag:: UInt32 , mask:: UInt32 = typemax (UInt32))
1014
- curr_flag = sv. src. ssaflags[sv. currpc]
1015
- sv. src. ssaflags[sv. currpc] = (curr_flag & ~ mask) | flag
1016
- end
1017
- function set_curr_ssaflag! (sv:: IRInterpretationState , flag:: UInt32 , mask:: UInt32 = typemax (UInt32))
1018
- curr_flag = sv. ir. stmts[sv. curridx][:flag ]
1019
- sv. ir. stmts[sv. curridx][:flag ] = (curr_flag & ~ mask) | flag
1016
+ curr_flag = sv. ssaflags[sv. currpc]
1017
+ sv. ssaflags[sv. currpc] = (curr_flag & ~ mask) | flag
1018
+ nothing
1020
1019
end
1021
1020
1022
- add_curr_ssaflag! (sv:: InferenceState , flag:: UInt32 ) = sv. src . ssaflags[sv. currpc] |= flag
1021
+ add_curr_ssaflag! (sv:: InferenceState , flag:: UInt32 ) = sv. ssaflags[sv. currpc] |= flag
1023
1022
add_curr_ssaflag! (sv:: IRInterpretationState , flag:: UInt32 ) = add_flag! (sv. ir. stmts[sv. curridx], flag)
1024
1023
1025
- sub_curr_ssaflag! (sv:: InferenceState , flag:: UInt32 ) = sv. src . ssaflags[sv. currpc] &= ~ flag
1024
+ sub_curr_ssaflag! (sv:: InferenceState , flag:: UInt32 ) = sv. ssaflags[sv. currpc] &= ~ flag
1026
1025
sub_curr_ssaflag! (sv:: IRInterpretationState , flag:: UInt32 ) = sub_flag! (sv. ir. stmts[sv. curridx], flag)
1027
1026
1028
1027
function merge_effects! (:: AbstractInterpreter , caller:: InferenceState , effects:: Effects )
@@ -1035,8 +1034,8 @@ function merge_effects!(::AbstractInterpreter, caller::InferenceState, effects::
1035
1034
end
1036
1035
merge_effects! (:: AbstractInterpreter , :: IRInterpretationState , :: Effects ) = return
1037
1036
1038
- decode_statement_effects_override (sv:: AbsIntState ) =
1039
- decode_statement_effects_override (get_curr_ssaflag (sv ))
1037
+ decode_statement_effects_override (sv:: InferenceState ) = decode_statement_effects_override (sv . src . ssaflags[sv . currpc])
1038
+ decode_statement_effects_override (sv :: IRInterpretationState ) = decode_statement_effects_override (UInt32 ( 0 ))
1040
1039
1041
1040
struct InferenceLoopState
1042
1041
rt
0 commit comments