Add a minimalistic reload pass.

The reload pass inserts spill and fill instructions as needed so
instructions that operate on registers will never see a value with stack
affinity.

This is a very basic implementation, and we can't write good test cases
until we have a spilling pass.
This commit is contained in:
Jakob Stoklund Olesen
2017-05-24 09:28:15 -07:00
parent ac1db6e3c9
commit d94bd8c236
5 changed files with 306 additions and 1 deletions

View File

@@ -64,6 +64,14 @@ impl Affinity {
}
}
/// Is this the `Stack` affinity?
pub fn is_stack(self) -> bool {
match self {
Affinity::Stack => true,
_ => false,
}
}
/// Merge an operand constraint into this affinity.
///
/// Note that this does not guarantee that the register allocator will pick a register that