Skip to content

Commit 45b00ba

Browse files
committed
Fix an effects bug that missed some control flow instructions
1 parent 008fb66 commit 45b00ba

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
@@ -4968,8 +4968,10 @@ impl Function {
49684968
},
49694969
insn => {
49704970
let insn_reads_memory = insn.effects_of().includes(Effect::read(abstract_heaps::Memory));
4971-
let insn_uses_control_flow = insn.effects_of().includes(effects::Control);
4972-
// TODO(Jacob): Once we update from extended basic blocks to normal basic blocks, we can remove the control flow check
4971+
let insn_uses_control_flow = insn.effects_of().includes(Effect::write(abstract_heaps::Control));
4972+
// TODO(Jacob): We should refine the control flow check
4973+
// For instance, we could sink the StoreField instruction into failed guards
4974+
// This allows us to preserve the dead store optimization.
49734975
if insn_reads_memory || insn_uses_control_flow {
49744976
compile_time_heap.clear();
49754977
}

0 commit comments

Comments
 (0)