Tweak comments in regalloc code.
This commit is contained in:
@@ -92,10 +92,8 @@ impl Affinity {
|
|||||||
// to change anything.
|
// to change anything.
|
||||||
if constraint.kind != ConstraintKind::Stack && !constraint.regclass.has_subclass(rc)
|
if constraint.kind != ConstraintKind::Stack && !constraint.regclass.has_subclass(rc)
|
||||||
{
|
{
|
||||||
// If the register classes don't overlap, `intersect` returns `Unassigned`, and
|
// If the register classes overlap, try to shrink our preferred register class.
|
||||||
// we just keep our previous affinity.
|
|
||||||
if let Some(subclass) = constraint.regclass.intersect_index(reginfo.rc(rc)) {
|
if let Some(subclass) = constraint.regclass.intersect_index(reginfo.rc(rc)) {
|
||||||
// This constraint shrinks our preferred register class.
|
|
||||||
*self = Self::Reg(subclass);
|
*self = Self::Reg(subclass);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -389,7 +389,6 @@ impl Liveness {
|
|||||||
// The liveness computation needs to visit all uses, but the order doesn't matter.
|
// The liveness computation needs to visit all uses, but the order doesn't matter.
|
||||||
// TODO: Perhaps this traversal of the function could be combined with a dead code
|
// TODO: Perhaps this traversal of the function could be combined with a dead code
|
||||||
// elimination pass if we visit a post-order of the dominator tree?
|
// elimination pass if we visit a post-order of the dominator tree?
|
||||||
// TODO: Resolve value aliases while we're visiting instructions?
|
|
||||||
for ebb in func.layout.ebbs() {
|
for ebb in func.layout.ebbs() {
|
||||||
// Make sure we have created live ranges for dead EBB parameters.
|
// Make sure we have created live ranges for dead EBB parameters.
|
||||||
// TODO: If these parameters are really dead, we could remove them, except for the
|
// TODO: If these parameters are really dead, we could remove them, except for the
|
||||||
@@ -436,11 +435,9 @@ impl Liveness {
|
|||||||
|
|
||||||
impl Index<Value> for Liveness {
|
impl Index<Value> for Liveness {
|
||||||
type Output = LiveRange;
|
type Output = LiveRange;
|
||||||
|
|
||||||
fn index(&self, index: Value) -> &LiveRange {
|
fn index(&self, index: Value) -> &LiveRange {
|
||||||
match self.ranges.get(index) {
|
self.ranges
|
||||||
Some(lr) => lr,
|
.get(index)
|
||||||
None => panic!("{} has no live range", index),
|
.unwrap_or_else(|| panic!("{} has no live range", index))
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user