pub struct GraphColorAllocator;Expand description
Greedy graph-coloring register allocator (interference graph from live intervals).
Intervals that overlap cannot share a register. Nodes are colored in descending
degree (Welsh–Powell order) to reduce spill pressure compared to arbitrary order.
When no color is available among available_regs, the interval is spilled using the
same slot layout as LinearScanAllocator::allocate.
Implementations§
Source§impl GraphColorAllocator
impl GraphColorAllocator
Sourcepub fn allocate<R: Copy + Eq + Hash>(
intervals: &[LiveInterval],
available_regs: &[R],
) -> HashMap<VirtualReg, Allocation<R>>
pub fn allocate<R: Copy + Eq + Hash>( intervals: &[LiveInterval], available_regs: &[R], ) -> HashMap<VirtualReg, Allocation<R>>
Color intervals using at most available_regs.len() registers.
intervals may be in any order; internally sorted by interference degree.
Auto Trait Implementations§
impl Freeze for GraphColorAllocator
impl RefUnwindSafe for GraphColorAllocator
impl Send for GraphColorAllocator
impl Sync for GraphColorAllocator
impl Unpin for GraphColorAllocator
impl UnsafeUnpin for GraphColorAllocator
impl UnwindSafe for GraphColorAllocator
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