Skip to main content

apply_allocation

Function apply_allocation 

Source
pub fn apply_allocation(mf: &mut MachineFunction, result: &RegAllocResult)
Expand description

Replace MOperand::VReg with MOperand::PReg in mf according to result. Also rewrites instr.dst so that the destination register number reflects the assigned physical register rather than the raw VReg counter. Spilled VRegs are left unchanged (the caller must handle them).

Also populates mf.used_callee_saved with any callee-saved registers that were actually assigned during allocation.