Basic spilling implementation.

Add a spilling pass which lowers register pressure by assigning SSA
values to the stack. Important missing features:

- Resolve conflicts where an instruction uses the same value more than
  once in incompatible ways.
- Deal with EBB arguments.

Fix bugs in the reload pass exposed by the first test case:

- Create live ranges for temporary registers.
- Set encodings on created spill and fill instructions.
This commit is contained in:
Jakob Stoklund Olesen
2017-06-08 10:33:22 -07:00
parent 96fe287f67
commit 36f189810e
8 changed files with 380 additions and 6 deletions

View File

@@ -39,6 +39,7 @@
use isa::registers::{RegInfo, MAX_TOPRCS, RegClass, RegClassMask};
use regalloc::AllocatableSet;
use std::cmp::min;
use std::fmt;
use std::iter::ExactSizeIterator;
/// Information per top-level register class.
@@ -225,6 +226,16 @@ impl Pressure {
}
}
impl fmt::Display for Pressure {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "Pressure[")?;
for rc in &self.toprc {
write!(f, " {}+{}/{}", rc.base_count, rc.transient_count, rc.limit)?;
}
write!(f, " ]")
}
}
#[cfg(test)]
mod tests {
use isa::{TargetIsa, RegClass};