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:
30
src/lib.rs
30
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<PReg> {
|
||||
match (self.vreg().is_invalid(), self.policy()) {
|
||||
(true, OperandPolicy::FixedReg(preg)) => Some(preg),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn bits(self) -> u32 {
|
||||
self.bits
|
||||
|
||||
Reference in New Issue
Block a user