Support mod (modify) operands, for better efficiency with regalloc.rs/Cranelift shim.

This commit is contained in:
Chris Fallin
2021-05-07 19:48:34 -07:00
parent d2cc4f1ac2
commit a6e3128821
4 changed files with 87 additions and 56 deletions

View File

@@ -47,6 +47,12 @@ pub fn validate_ssa<F: Function>(f: &F, cfginfo: &CFGInfo) -> Result<(), RegAllo
}
defined[operand.vreg().vreg()] = true;
}
OperandKind::Mod => {
// Mod (modify) operands are not used in SSA,
// but can be used by non-SSA code (e.g. with
// the regalloc.rs compatibility shim).
return Err(RegAllocError::SSA(operand.vreg(), iix));
}
}
}
}