From 245c21228901dc540701c771d408f3301582ae50 Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Sun, 20 Jun 2021 23:03:44 -0700 Subject: [PATCH] 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 736f636c36954fb4e86701da9d5cd5a44f5ea7ed. --- src/ion/dump.rs | 2 +- src/ion/liveranges.rs | 12 ------------ src/lib.rs | 30 ------------------------------ 3 files changed, 1 insertion(+), 43 deletions(-) diff --git a/src/ion/dump.rs b/src/ion/dump.rs index bb1729b..c291253 100644 --- a/src/ion/dump.rs +++ b/src/ion/dump.rs @@ -1,7 +1,7 @@ //! Debugging output. use super::Env; -use crate::{Block, Function, ProgPoint}; +use crate::{Function, ProgPoint, Block}; impl<'a, F: Function> Env<'a, F> { pub fn dump_state(&self) { diff --git a/src/ion/liveranges.rs b/src/ion/liveranges.rs index 8bf48e4..4189502 100644 --- a/src/ion/liveranges.rs +++ b/src/ion/liveranges.rs @@ -272,9 +272,6 @@ impl<'a, F: Function> Env<'a, F> { for pos in &[OperandPos::After, OperandPos::Before] { for op in self.func.inst_operands(inst) { - if op.as_fixed().is_some() { - continue; - } if op.pos() == *pos { let was_live = live.get(op.vreg().vreg()); log::debug!("op {:?} was_live = {}", op, was_live); @@ -871,15 +868,6 @@ impl<'a, F: Function> Env<'a, F> { 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() { OperandKind::Def | OperandKind::Mod => { log::debug!("Def of {} at {:?}", operand.vreg(), pos); diff --git a/src/lib.rs b/src/lib.rs index 1396cec..3134955 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -144,15 +144,6 @@ impl VReg { pub fn invalid() -> Self { 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 { @@ -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)] pub fn vreg(self) -> VReg { 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 { - match (self.vreg().is_invalid(), self.policy()) { - (true, OperandPolicy::FixedReg(preg)) => Some(preg), - _ => None, - } - } - #[inline(always)] pub fn bits(self) -> u32 { self.bits