Struct cranelift_codegen::binemit::RegDiversions
source · pub struct RegDiversions { /* private fields */ }Expand description
Keep track of diversions in an EBB.
Implementations§
source§impl RegDiversions
impl RegDiversions
sourcepub fn diversion(&self, value: Value) -> Option<&Diversion>
pub fn diversion(&self, value: Value) -> Option<&Diversion>
Get the current diversion of value, if any.
sourcepub fn get(&self, value: Value, locations: &ValueLocations) -> ValueLoc
pub fn get(&self, value: Value, locations: &ValueLocations) -> ValueLoc
Get the current location for value. Fall back to the assignment map for non-diverted
values
sourcepub fn reg(&self, value: Value, locations: &ValueLocations) -> RegUnit
pub fn reg(&self, value: Value, locations: &ValueLocations) -> RegUnit
Get the current register location for value, or panic if value isn’t in a register.
sourcepub fn stack(&self, value: Value, locations: &ValueLocations) -> StackSlot
pub fn stack(&self, value: Value, locations: &ValueLocations) -> StackSlot
Get the current stack location for value, or panic if value isn’t in a stack slot.
sourcepub fn divert(&mut self, value: Value, from: ValueLoc, to: ValueLoc)
pub fn divert(&mut self, value: Value, from: ValueLoc, to: ValueLoc)
Record any kind of move.
The from location must match an existing to location, if any.
sourcepub fn regmove(&mut self, value: Value, from: RegUnit, to: RegUnit)
pub fn regmove(&mut self, value: Value, from: RegUnit, to: RegUnit)
Record a register -> register move.
sourcepub fn regspill(&mut self, value: Value, from: RegUnit, to: StackSlot)
pub fn regspill(&mut self, value: Value, from: RegUnit, to: StackSlot)
Record a register -> stack move.
sourcepub fn regfill(&mut self, value: Value, from: StackSlot, to: RegUnit)
pub fn regfill(&mut self, value: Value, from: StackSlot, to: RegUnit)
Record a stack -> register move.
sourcepub fn apply(&mut self, inst: &InstructionData)
pub fn apply(&mut self, inst: &InstructionData)
Apply the effect of inst.
If inst is a regmove, regfill, or regspill instruction, update the diversions to
match.