@@ -134,11 +134,16 @@ function concrete_eval_invoke(interp::AbstractInterpreter, ir::IRCode, mi_cache,
134
134
return nothing
135
135
end
136
136
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
+
137
141
function reprocess_instruction! (interp:: AbstractInterpreter , ir:: IRCode , mi:: MethodInstance ,
138
142
mi_cache,
139
143
tpdum:: TwoPhaseDefUseMap , idx:: Int , bb:: Union{Int, Nothing} ,
140
144
@nospecialize (inst), @nospecialize (typ),
141
- phi_revisit:: BitSet )
145
+ phi_revisit:: BitSet ,
146
+ dt:: LazyDomtree )
142
147
function update_phi! (from:: Int , to:: Int )
143
148
if length (ir. cfg. blocks[to]. preds) == 0
144
149
return
@@ -181,7 +186,7 @@ function reprocess_instruction!(interp::AbstractInterpreter, ir::IRCode, mi::Met
181
186
if isa (inst, Expr) || isa (inst, PhiNode)
182
187
if isa (inst, PhiNode) || inst. head === :call || inst. head === :foreigncall || inst. head === :new
183
188
if isa (inst, PhiNode)
184
- rt = abstract_eval_phi (interp, inst, nothing , ir )
189
+ rt = abstract_eval_phi_stmt (interp, inst, ir, idx, dt )
185
190
else
186
191
(;rt, effects) = abstract_eval_statement_expr (interp, inst, nothing , ir, mi)
187
192
# All other effects already guaranteed effect free by construction
@@ -243,6 +248,7 @@ function _ir_abstract_constant_propagation(interp::AbstractInterpreter, mi_cache
243
248
all_rets = Int[]
244
249
245
250
tpdum = TwoPhaseDefUseMap (length (ir. stmts))
251
+ dt = LazyDomtree (ir)
246
252
247
253
"""
248
254
process_terminator!
@@ -303,7 +309,7 @@ function _ir_abstract_constant_propagation(interp::AbstractInterpreter, mi_cache
303
309
delete! (ssa_refined, idx)
304
310
end
305
311
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 )
307
313
push! (ssa_refined, idx)
308
314
end
309
315
if idx == lstmt && process_terminator! (ip, bb, idx)
@@ -370,7 +376,7 @@ function _ir_abstract_constant_propagation(interp::AbstractInterpreter, mi_cache
370
376
inst = ir. stmts[idx][:inst ]
371
377
typ = ir. stmts[idx][:type ]
372
378
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 )
374
380
append! (stmt_ip, tpdum[idx])
375
381
end
376
382
end
0 commit comments