Skip to main content

loads

Function loads 

Source
pub fn loads(
    func: &mut Func,
    machine: &MachineInsts,
    names: &mut Interner,
    pending: &mut Pending<'_>,
) -> usize
Expand description

Puts every load that can move into the arithmetic that reads it, and gives back how many.

pending is the addresses crate::finish has still to write a displacement into, and a load that moves takes its entry with it, the same way one folded into a reader does. An address into the frame arrives here already inside the load, because crate::fold has run.

Run after selection and after the addresses are folded, and before allocation. Before the allocator because what makes the pair safe to put together is that a virtual register is written once, and after the addresses because a load whose address is still a lea in front of it has nothing in its own memory operand worth carrying.