Remove regs from MachineEnv
It isn't exactly clear what purpose it serves.
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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<PReg>,
|
||||
|
||||
/// Preferred physical registers for each class. These are the
|
||||
/// registers that will be allocated first, if free.
|
||||
pub preferred_regs_by_class: [Vec<PReg>; 2],
|
||||
|
||||
Reference in New Issue
Block a user