@@ -4,7 +4,7 @@ function codeinst_to_ir(interp::AbstractInterpreter, code::CodeInstance)
44 mi = code. def
55
66 if isa (src, Vector{UInt8})
7- src = ccall (:jl_uncompress_ir , Any, (Any, Ptr{Cvoid}, Any), mi. def, C_NULL , src:: Vector{UInt8} ):: CodeInfo
7+ src = ccall (:jl_uncompress_ir , Any, (Any, Ptr{Cvoid}, Any), mi. def, C_NULL , src):: CodeInfo
88 end
99
1010 isa (src, CodeInfo) || return src
@@ -111,7 +111,7 @@ function concrete_eval_invoke(interp::AbstractInterpreter, ir::IRCode, mi_cache,
111111 argtypes = collect_argtypes (interp, inst. args[2 : end ], nothing , ir)
112112 effects = decode_effects (code. ipo_purity_bits)
113113 if is_foldable (effects) && is_all_const_arg (argtypes)
114- args = collect_const_args (argtypes, 1 )
114+ args = collect_semi_const_args (argtypes, 1 )
115115 world = get_world_counter (interp)
116116 value = try
117117 Core. _call_in_world_total (world, args... )
@@ -137,8 +137,8 @@ function reprocess_instruction!(interp::AbstractInterpreter, ir::IRCode, mi::Met
137137 mi_cache, sv:: InferenceState ,
138138 tpdum:: TwoPhaseDefUseMap , idx:: Int , bb:: Union{Int, Nothing} ,
139139 @nospecialize (inst), @nospecialize (typ),
140- phi_revisit)
141- function update_phi! (from, to)
140+ phi_revisit:: BitSet )
141+ function update_phi! (from:: Int , to:: Int )
142142 if length (ir. cfg. blocks[to]. preds) == 0
143143 return
144144 end
@@ -224,14 +224,14 @@ function reprocess_instruction!(interp::AbstractInterpreter, ir::IRCode, mi::Met
224224 return false
225225end
226226
227- function _ir_abstract_constant_propagation (interp:: AbstractInterpreter , mi_cache, frame:: InferenceState , mi:: MethodInstance , ir, argtypes)
227+ function _ir_abstract_constant_propagation (interp:: AbstractInterpreter , mi_cache,
228+ frame:: InferenceState , mi:: MethodInstance , ir:: IRCode , argtypes:: Vector{Any} )
228229 argtypes = va_process_argtypes (argtypes, mi)
229230 argtypes_refined = Bool[! (ir. argtypes[i] ⊑ argtypes[i]) for i = 1 : length (argtypes)]
230231 empty! (ir. argtypes)
231232 append! (ir. argtypes, argtypes)
232233 ssa_refined = BitSet ()
233234
234- ultimate_rt = Union{}
235235 bbs = ir. cfg. blocks
236236 ip = BitSetBoundedMinPrioritySet (length (bbs))
237237 push! (ip, 1 )
@@ -245,7 +245,7 @@ function _ir_abstract_constant_propagation(interp::AbstractInterpreter, mi_cache
245245 Process the terminator and add the successor to `ip`. Returns whether a
246246 backedge was seen.
247247 """
248- function process_terminator! (ip, bb, idx)
248+ function process_terminator! (ip:: BitSetBoundedMinPrioritySet , bb:: Int , idx:: Int )
249249 inst = ir. stmts[idx][:inst ]
250250 if isa (inst, ReturnNode)
251251 if isdefined (inst, :val )
@@ -378,14 +378,15 @@ function _ir_abstract_constant_propagation(interp::AbstractInterpreter, mi_cache
378378 # Could have discovered this block is dead after the initial scan
379379 continue
380380 end
381- inst = ir. stmts[idx][:inst ]
381+ inst = ir. stmts[idx][:inst ]:: ReturnNode
382382 rt = argextype (inst. val, ir)
383383 ultimate_rt = tmerge (ultimate_rt, rt)
384384 end
385385 return ultimate_rt
386386end
387387
388- function ir_abstract_constant_propagation (interp:: AbstractInterpreter , mi_cache, frame:: InferenceState , mi:: MethodInstance , ir, argtypes)
388+ function ir_abstract_constant_propagation (interp:: AbstractInterpreter , mi_cache,
389+ frame:: InferenceState , mi:: MethodInstance , ir:: IRCode , argtypes:: Vector{Any} )
389390 if __measure_typeinf__[]
390391 inf_frame = Timings. InferenceFrameInfo (mi, frame. world, Any[], Any[], length (ir. argtypes))
391392 Timings. enter_new_timer (inf_frame)
0 commit comments