Skip to content

Commit ac6ae71

Browse files
committed
Fix an effects bug that missed some control flow instructions
1 parent cd003d5 commit ac6ae71

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

zjit/src/hir.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4956,8 +4956,10 @@ impl Function {
49564956
},
49574957
insn => {
49584958
let insn_reads_memory = insn.effects_of().includes(Effect::read(abstract_heaps::Memory));
4959-
let insn_uses_control_flow = insn.effects_of().includes(effects::Control);
4960-
// TODO(Jacob): Once we update from extended basic blocks to normal basic blocks, we can remove the control flow check
4959+
let insn_uses_control_flow = insn.effects_of().includes(Effect::write(abstract_heaps::Control));
4960+
// TODO(Jacob): We should refine the control flow check
4961+
// For instance, we could sink the StoreField instruction into failed guards
4962+
// This allows us to preserve the dead store optimization.
49614963
if insn_reads_memory || insn_uses_control_flow {
49624964
compile_time_heap.clear();
49634965
}

0 commit comments

Comments
 (0)