Bugfix: Mod with dead def spans both Before and After positions
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user