pub struct LiveInterval {
pub vreg: LcnfVarId,
pub start: u32,
pub end: u32,
pub uses: Vec<u32>,
pub defs: Vec<u32>,
pub spill_weight: f64,
}Expand description
The live interval [start, end) of a virtual register.
start is the instruction index where the vreg is first defined,
end is one past the last use.
Fields§
§vreg: LcnfVarIdThe virtual register this interval belongs to.
start: u32Inclusive start (def point).
end: u32Exclusive end (last use + 1).
uses: Vec<u32>All use points (instruction indices where this vreg is read).
defs: Vec<u32>All def points (instruction indices where this vreg is written).
spill_weight: f64Spill weight: higher = more costly to spill.
Implementations§
Source§impl LiveInterval
impl LiveInterval
Sourcepub fn overlaps(&self, other: &LiveInterval) -> bool
pub fn overlaps(&self, other: &LiveInterval) -> bool
Returns true if this interval overlaps with other.
Sourcepub fn compute_spill_weight(&mut self)
pub fn compute_spill_weight(&mut self)
Compute spill weight = total uses / length (more uses → costlier to spill).
Trait Implementations§
Source§impl Clone for LiveInterval
impl Clone for LiveInterval
Source§fn clone(&self) -> LiveInterval
fn clone(&self) -> LiveInterval
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LiveInterval
impl Debug for LiveInterval
Source§impl PartialEq for LiveInterval
impl PartialEq for LiveInterval
impl StructuralPartialEq for LiveInterval
Auto Trait Implementations§
impl Freeze for LiveInterval
impl RefUnwindSafe for LiveInterval
impl Send for LiveInterval
impl Sync for LiveInterval
impl Unpin for LiveInterval
impl UnsafeUnpin for LiveInterval
impl UnwindSafe for LiveInterval
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more