@@ -134,11 +134,16 @@ function concrete_eval_invoke(interp::AbstractInterpreter, ir::IRCode, mi_cache,
134134 return nothing
135135end
136136
137+ function abstract_eval_phi_stmt (interp:: AbstractInterpreter , phi:: PhiNode , ir:: IRCode , id:: Int , dt:: LazyDomtree )
138+ return abstract_eval_phi (interp, phi, nothing , ir)
139+ end
140+
137141function reprocess_instruction! (interp:: AbstractInterpreter , ir:: IRCode , mi:: MethodInstance ,
138142 mi_cache,
139143 tpdum:: TwoPhaseDefUseMap , idx:: Int , bb:: Union{Int, Nothing} ,
140144 @nospecialize (inst), @nospecialize (typ),
141- phi_revisit:: BitSet )
145+ phi_revisit:: BitSet ,
146+ dt:: LazyDomtree )
142147 function update_phi! (from:: Int , to:: Int )
143148 if length (ir. cfg. blocks[to]. preds) == 0
144149 return
@@ -181,7 +186,7 @@ function reprocess_instruction!(interp::AbstractInterpreter, ir::IRCode, mi::Met
181186 if isa (inst, Expr) || isa (inst, PhiNode)
182187 if isa (inst, PhiNode) || inst. head === :call || inst. head === :foreigncall || inst. head === :new
183188 if isa (inst, PhiNode)
184- rt = abstract_eval_phi (interp, inst, nothing , ir )
189+ rt = abstract_eval_phi_stmt (interp, inst, ir, idx, dt )
185190 else
186191 (;rt, effects) = abstract_eval_statement_expr (interp, inst, nothing , ir, mi)
187192 # All other effects already guaranteed effect free by construction
@@ -243,6 +248,7 @@ function _ir_abstract_constant_propagation(interp::AbstractInterpreter, mi_cache
243248 all_rets = Int[]
244249
245250 tpdum = TwoPhaseDefUseMap (length (ir. stmts))
251+ dt = LazyDomtree (ir)
246252
247253 """
248254 process_terminator!
@@ -303,7 +309,7 @@ function _ir_abstract_constant_propagation(interp::AbstractInterpreter, mi_cache
303309 delete! (ssa_refined, idx)
304310 end
305311 if any_refined && reprocess_instruction! (interp, ir, mi, mi_cache,
306- tpdum, idx, bb, inst, typ, ssa_refined)
312+ tpdum, idx, bb, inst, typ, ssa_refined, dt )
307313 push! (ssa_refined, idx)
308314 end
309315 if idx == lstmt && process_terminator! (ip, bb, idx)
@@ -370,7 +376,7 @@ function _ir_abstract_constant_propagation(interp::AbstractInterpreter, mi_cache
370376 inst = ir. stmts[idx][:inst ]
371377 typ = ir. stmts[idx][:type ]
372378 if reprocess_instruction! (interp, ir, mi, mi_cache,
373- tpdum, idx, nothing , inst, typ, ssa_refined)
379+ tpdum, idx, nothing , inst, typ, ssa_refined, dt )
374380 append! (stmt_ip, tpdum[idx])
375381 end
376382 end
0 commit comments