Constrain solver variables as little as possible.

When solver variables represent operands on the current instruction,
they need to be constrained as required by the instructions, but
variables that are simply moved out of the way should only be
constrained to their top-level register class. The live range affinity
is just a hint, not a requirement.
This commit is contained in:
Jakob Stoklund Olesen
2017-10-06 15:03:50 -07:00
parent 12a8d6cce1
commit ac8c8a676a
2 changed files with 16 additions and 15 deletions

View File

@@ -296,6 +296,11 @@ impl RegInfo {
pub fn rc(&self, idx: RegClassIndex) -> RegClass {
self.classes[idx.index()]
}
/// Get the top-level register class containing the `idx` class.
pub fn toprc(&self, idx: RegClassIndex) -> RegClass {
self.classes[self.rc(idx).toprc as usize]
}
}
/// Temporary object that holds enough information to print a register unit.