Revert "Add fixed-non-allocatable operand support."

This feature needs more thought; for now we will of course continue to
support pinned vregs, but perhaps we can do better for
"pass-through-and-forget" operands that are given non-allocatable
registers.

This reverts commit 736f636c36.
This commit is contained in:
Chris Fallin
2021-06-20 23:03:44 -07:00
parent 21fb233809
commit 245c212289
3 changed files with 1 additions and 43 deletions

View File

@@ -1,7 +1,7 @@
//! Debugging output. //! Debugging output.
use super::Env; use super::Env;
use crate::{Block, Function, ProgPoint}; use crate::{Function, ProgPoint, Block};
impl<'a, F: Function> Env<'a, F> { impl<'a, F: Function> Env<'a, F> {
pub fn dump_state(&self) { pub fn dump_state(&self) {

View File

@@ -272,9 +272,6 @@ impl<'a, F: Function> Env<'a, F> {
for pos in &[OperandPos::After, OperandPos::Before] { for pos in &[OperandPos::After, OperandPos::Before] {
for op in self.func.inst_operands(inst) { for op in self.func.inst_operands(inst) {
if op.as_fixed().is_some() {
continue;
}
if op.pos() == *pos { if op.pos() == *pos {
let was_live = live.get(op.vreg().vreg()); let was_live = live.get(op.vreg().vreg());
log::debug!("op {:?} was_live = {}", op, was_live); log::debug!("op {:?} was_live = {}", op, was_live);
@@ -871,15 +868,6 @@ impl<'a, F: Function> Env<'a, F> {
operand operand
); );
// If this is a "fixed non-allocatable
// register" operand, set the alloc
// immediately and then ignore the operand
// hereafter.
if let Some(preg) = operand.as_fixed() {
self.set_alloc(inst, i, Allocation::reg(preg));
continue;
}
match operand.kind() { match operand.kind() {
OperandKind::Def | OperandKind::Mod => { OperandKind::Def | OperandKind::Mod => {
log::debug!("Def of {} at {:?}", operand.vreg(), pos); log::debug!("Def of {} at {:?}", operand.vreg(), pos);

View File

@@ -144,15 +144,6 @@ impl VReg {
pub fn invalid() -> Self { pub fn invalid() -> Self {
VReg::new(Self::MAX, RegClass::Int) VReg::new(Self::MAX, RegClass::Int)
} }
#[inline(always)]
pub fn is_valid(self) -> bool {
self != Self::invalid()
}
#[inline(always)]
pub fn is_invalid(self) -> bool {
self == Self::invalid()
}
} }
impl std::fmt::Debug for VReg { impl std::fmt::Debug for VReg {
@@ -337,19 +328,6 @@ impl Operand {
) )
} }
/// Create an Operand that always results in an assignment to the
/// given fixed `preg`, *without* tracking liveranges in that
/// `preg`. Must only be used for non-allocatable registers.
#[inline(always)]
pub fn fixed(preg: PReg) -> Self {
Operand::new(
VReg::invalid(),
OperandPolicy::FixedReg(preg),
OperandKind::Use, // doesn't matter
OperandPos::Before, // doesn't matter
)
}
#[inline(always)] #[inline(always)]
pub fn vreg(self) -> VReg { pub fn vreg(self) -> VReg {
let vreg_idx = ((self.bits as usize) & VReg::MAX) as usize; let vreg_idx = ((self.bits as usize) & VReg::MAX) as usize;
@@ -401,14 +379,6 @@ impl Operand {
} }
} }
#[inline(always)]
pub fn as_fixed(self) -> Option<PReg> {
match (self.vreg().is_invalid(), self.policy()) {
(true, OperandPolicy::FixedReg(preg)) => Some(preg),
_ => None,
}
}
#[inline(always)] #[inline(always)]
pub fn bits(self) -> u32 { pub fn bits(self) -> u32 {
self.bits self.bits