pub struct InterferenceGraph {
pub adj: HashMap<VReg, HashSet<VReg>>,
pub moves: Vec<(VReg, VReg)>,
pub ranges: HashMap<VReg, LiveRange>,
}Expand description
Interference graph for register allocation.
Fields§
§adj: HashMap<VReg, HashSet<VReg>>Adjacency sets: for each VReg, the set of interfering VRegs.
moves: Vec<(VReg, VReg)>Move pairs (dest, src) for coalescing.
ranges: HashMap<VReg, LiveRange>Live ranges for each VReg.
Implementations§
Source§impl InterferenceGraph
impl InterferenceGraph
Sourcepub fn build(instructions: &[LirInst]) -> Self
pub fn build(instructions: &[LirInst]) -> Self
Build the interference graph from LIR instructions.
Sourcepub fn build_with_params(instructions: &[LirInst], num_params: u32) -> Self
pub fn build_with_params(instructions: &[LirInst], num_params: u32) -> Self
Build the interference graph, extending param VReg live ranges to start at 0.
Sourcepub fn interferes(&self, a: VReg, b: VReg) -> bool
pub fn interferes(&self, a: VReg, b: VReg) -> bool
Returns true if two VRegs interfere.
Auto Trait Implementations§
impl Freeze for InterferenceGraph
impl RefUnwindSafe for InterferenceGraph
impl Send for InterferenceGraph
impl Sync for InterferenceGraph
impl Unpin for InterferenceGraph
impl UnsafeUnpin for InterferenceGraph
impl UnwindSafe for InterferenceGraph
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