Remove mod operands. (#109)

* Remove Mod operands.

* Typo fix.
This commit is contained in:
Chris Fallin
2023-01-24 17:41:46 -08:00
committed by GitHub
parent e09f6519a6
commit 0edb11d3a7
4 changed files with 19 additions and 34 deletions

View File

@@ -373,7 +373,7 @@ impl<'a, F: Function> Env<'a, F> {
let was_live = live.get(op.vreg().vreg());
trace!("op {:?} was_live = {}", op, was_live);
match op.kind() {
OperandKind::Use | OperandKind::Mod => {
OperandKind::Use => {
live.set(op.vreg().vreg(), true);
}
OperandKind::Def => {
@@ -776,7 +776,6 @@ impl<'a, F: Function> Env<'a, F> {
.cloned()
.unwrap_or(self.func.inst_operands(inst)[i]);
let pos = match (operand.kind(), operand.pos()) {
(OperandKind::Mod, _) => ProgPoint::before(inst),
(OperandKind::Def, OperandPos::Early) => ProgPoint::before(inst),
(OperandKind::Def, OperandPos::Late) => ProgPoint::after(inst),
(OperandKind::Use, OperandPos::Late) => ProgPoint::after(inst),
@@ -817,7 +816,7 @@ impl<'a, F: Function> Env<'a, F> {
}
match operand.kind() {
OperandKind::Def | OperandKind::Mod => {
OperandKind::Def => {
trace!("Def of {} at {:?}", operand.vreg(), pos);
// Get or create the LiveRange.
@@ -825,11 +824,7 @@ impl<'a, F: Function> Env<'a, F> {
trace!(" -> has existing LR {:?}", lr);
// If there was no liverange (dead def), create a trivial one.
if !live.get(operand.vreg().vreg()) {
let from = match operand.kind() {
OperandKind::Def => pos,
OperandKind::Mod => self.cfginfo.block_entry[block.index()],
_ => unreachable!(),
};
let from = pos;
// We want to we want to span
// until Before of the next
// inst. This ensures that early

View File

@@ -906,7 +906,7 @@ impl<'a, F: Function> Env<'a, F> {
let inst = Inst::new(inst);
for (i, op) in this.func.inst_operands(inst).iter().enumerate() {
match op.kind() {
OperandKind::Def | OperandKind::Mod => {
OperandKind::Def => {
let alloc = this.get_alloc(inst, i);
redundant_moves.clear_alloc(alloc);
}