Add support for fixed stack slots

This works by allowing a PReg to be marked as being a stack location
instead of a physical register.
This commit is contained in:
Amanieu d'Antras
2021-11-28 17:52:50 +00:00
parent 2f433929c4
commit 77e6a9e0d7
8 changed files with 54 additions and 25 deletions

View File

@@ -102,6 +102,7 @@ impl<'a, F: Function> Env<'a, F> {
PRegData {
reg: PReg::invalid(),
allocations: LiveRangeSet::new(),
is_stack: false,
},
);
for i in 0..=PReg::MAX {
@@ -110,6 +111,9 @@ impl<'a, F: Function> Env<'a, F> {
let preg_float = PReg::new(i, RegClass::Float);
self.pregs[preg_float.index()].reg = preg_float;
}
for &preg in &self.env.fixed_stack_slots {
self.pregs[preg.index()].is_stack = true;
}
// Create VRegs from the vreg count.
for idx in 0..self.func.num_vregs() {
// We'll fill in the real details when we see the def.