Bugfix: Mod with dead def spans both Before and After positions

This commit is contained in:
Chris Fallin
2021-05-08 15:47:38 -07:00
parent ed339ab4d8
commit 179ef0e534

View File

@@ -1432,12 +1432,14 @@ impl<'a, F: Function> Env<'a, F> {
OperandKind::Mod => self.cfginfo.block_entry[block.index()], OperandKind::Mod => self.cfginfo.block_entry[block.index()],
_ => unreachable!(), _ => unreachable!(),
}; };
let to = match operand.kind() {
OperandKind::Def => pos.next(),
OperandKind::Mod => pos.next().next(), // both Before and After positions
_ => unreachable!(),
};
lr = self.add_liverange_to_vreg( lr = self.add_liverange_to_vreg(
VRegIndex::new(operand.vreg().vreg()), VRegIndex::new(operand.vreg().vreg()),
CodeRange { CodeRange { from, to },
from,
to: pos.next(),
},
&mut num_ranges, &mut num_ranges,
); );
log::debug!(" -> invalid; created {:?}", lr); log::debug!(" -> invalid; created {:?}", lr);