@@ -267,6 +267,7 @@ mutable struct InferenceState
267267 bb_vartables:: Vector{Union{Nothing,VarTable}} # nothing if not analyzed yet
268268 bb_saw_latestworld:: Vector{Bool}
269269 ssavaluetypes:: Vector{Any}
270+ ssaflags:: Vector{UInt32}
270271 edges:: Vector{Any}
271272 stmt_info:: Vector{CallInfo}
272273
@@ -343,6 +344,7 @@ mutable struct InferenceState
343344 bb_vartable1[i] = VarState (argtyp, i > nargtypes)
344345 end
345346 src. ssavaluetypes = ssavaluetypes = Any[ NOT_FOUND for i = 1 : nssavalues ]
347+ ssaflags = copy (src. ssaflags)
346348
347349 unreachable = BitSet ()
348350 pclimitations = IdSet {InferenceState} ()
@@ -374,7 +376,7 @@ mutable struct InferenceState
374376
375377 this = new (
376378 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,
378380 tasks, pclimitations, limitations, cycle_backedges, callstack, parentid, frameid, cycleid,
379381 result, unreachable, bestguess, exc_bestguess, ipo_effects,
380382 restrict_abstract_call_sites, cache_mode, insert_coverage,
@@ -1004,25 +1006,22 @@ function callers_in_cycle(sv::InferenceState)
10041006end
10051007callers_in_cycle (sv:: IRInterpretationState ) = AbsIntCycle (sv. callstack:: Vector{AbsIntState} , 0 , 0 )
10061008
1007- get_curr_ssaflag (sv:: InferenceState ) = sv. src . ssaflags[sv. currpc]
1009+ get_curr_ssaflag (sv:: InferenceState ) = sv. ssaflags[sv. currpc]
10081010get_curr_ssaflag (sv:: IRInterpretationState ) = sv. ir. stmts[sv. curridx][:flag ]
10091011
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)
10111013has_curr_ssaflag (sv:: IRInterpretationState , flag:: UInt32 ) = has_flag (sv. ir. stmts[sv. curridx][:flag ], flag)
10121014
10131015function 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
10201019end
10211020
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
10231022add_curr_ssaflag! (sv:: IRInterpretationState , flag:: UInt32 ) = add_flag! (sv. ir. stmts[sv. curridx], flag)
10241023
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
10261025sub_curr_ssaflag! (sv:: IRInterpretationState , flag:: UInt32 ) = sub_flag! (sv. ir. stmts[sv. curridx], flag)
10271026
10281027function merge_effects! (:: AbstractInterpreter , caller:: InferenceState , effects:: Effects )
@@ -1035,8 +1034,8 @@ function merge_effects!(::AbstractInterpreter, caller::InferenceState, effects::
10351034end
10361035merge_effects! (:: AbstractInterpreter , :: IRInterpretationState , :: Effects ) = return
10371036
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 ))
10401039
10411040struct InferenceLoopState
10421041 rt
0 commit comments