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

@@ -1154,6 +1154,14 @@ pub struct MachineEnv {
/// the emission of two machine-code instructions, this lowering
/// can use the scratch register between them.
pub scratch_by_class: [PReg; 2],
/// Some `PReg`s can be designated as locations on the stack rather than
/// actual registers. These can be used to tell the register allocator about
/// pre-defined stack slots used for function arguments and return values.
///
/// `PReg`s in this list cannot be used as a scratch register or as an
/// allocatable regsiter.
pub fixed_stack_slots: Vec<PReg>,
}
/// The output of the register allocator.