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:
@@ -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};
|
||||
|
||||
Reference in New Issue
Block a user