Implement coloring::iterate_solution().
It can happen that the currently live registers are blocking a smaller register class completely, so the only way of solving the allocation problem is to turn some of the live-through registers into solver variables. When the quick_solve attempt fails, try to free up registers in the critical register class by turning live-through values into solver variables.
This commit is contained in:
@@ -167,7 +167,7 @@ impl RegClassData {
|
||||
}
|
||||
|
||||
/// Returns true if `other` is a subclass of this register class.
|
||||
/// A register class is considerd to be a subclass of itself.
|
||||
/// A register class is considered to be a subclass of itself.
|
||||
pub fn has_subclass<RCI: Into<RegClassIndex>>(&self, other: RCI) -> bool {
|
||||
self.subclasses & (1 << other.into().0) != 0
|
||||
}
|
||||
@@ -276,6 +276,11 @@ impl RegInfo {
|
||||
pub fn rc(&self, idx: RegClassIndex) -> RegClass {
|
||||
&self.classes[idx.index()]
|
||||
}
|
||||
|
||||
/// Get the top-level register class containing `rc`.
|
||||
pub fn toprc(&self, rc: RegClass) -> RegClass {
|
||||
&self.classes[rc.toprc as usize]
|
||||
}
|
||||
}
|
||||
|
||||
/// Temporary object that holds enough information to print a register unit.
|
||||
|
||||
Reference in New Issue
Block a user