Implement a move resolver for the register constraint solver.

After finding a register solution, it need to be executed as a sequence
of regmove instructions. This often requires a topological ordering of
the moves so they don't conflict.

When the solution contains cycles, try to grab an available scratch
register to implement the copies. Panic if that fails (later, we'll
implement emergency spilling in this case).

Make sure we handle odd aliasing in the arm32 floating point register
bank. Not everything is a simple cycle in that case, so make sure we
don't assume so.
This commit is contained in:
Jakob Stoklund Olesen
2017-05-10 15:36:14 -07:00
parent b521254149
commit 9be262e878
3 changed files with 302 additions and 8 deletions

View File

@@ -164,6 +164,12 @@ impl fmt::Display for RegClassData {
}
}
impl fmt::Debug for RegClassData {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(self.name)
}
}
/// A small reference to a register class.
///
/// Use this when storing register classes in compact data structures. The `RegInfo::rc()` method