diff --git a/src/fuzzing/func.rs b/src/fuzzing/func.rs index 320fe95..38e7400 100644 --- a/src/fuzzing/func.rs +++ b/src/fuzzing/func.rs @@ -589,7 +589,6 @@ pub fn machine_env() -> MachineEnv { [regs.iter().cloned().skip(24).collect(), vec![]]; let scratch_by_class: [PReg; 2] = [PReg::new(31, RegClass::Int), PReg::new(0, RegClass::Float)]; MachineEnv { - regs, preferred_regs_by_class, non_preferred_regs_by_class, scratch_by_class, diff --git a/src/ion/liveranges.rs b/src/ion/liveranges.rs index 501d9f5..4c9e949 100644 --- a/src/ion/liveranges.rs +++ b/src/ion/liveranges.rs @@ -105,8 +105,11 @@ impl<'a, F: Function> Env<'a, F> { allocations: LiveRangeSet::new(), }, ); - for &preg in &self.env.regs { - self.pregs[preg.index()].reg = preg; + for i in 0..=PReg::MAX { + let preg_int = PReg::new(i, RegClass::Int); + self.pregs[preg_int.index()].reg = preg_int; + let preg_float = PReg::new(i, RegClass::Float); + self.pregs[preg_float.index()].reg = preg_float; } // Create VRegs from the vreg count. for idx in 0..self.func.num_vregs() { diff --git a/src/lib.rs b/src/lib.rs index 86afea7..2c56d5a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1139,12 +1139,6 @@ pub enum Edit { /// as well. #[derive(Clone, Debug)] pub struct MachineEnv { - /// Physical registers. Every register that might be mentioned in - /// any constraint must be listed here, even if it is not - /// allocatable (present in one of - /// `{preferred,non_preferred}_regs_by_class`). - pub regs: Vec, - /// Preferred physical registers for each class. These are the /// registers that will be allocated first, if free. pub preferred_regs_by_class: [Vec; 2],