[LLVMdev] Recalculating live intervals

Fernando Magno Quintao Pereira fernando at CS.UCLA.EDU
Mon Aug 21 11:22:09 PDT 2006


Well, someone correct me if am wrong, but, you still have to allocate
physical registers to them, because their values must be reloaded before
been used. But after you spill a register, you break its live ranges, so,
each use of that register can be loaded into a different physical. In my
register allocator, after I spill reg_v:

For each use of reg_v:
    create a new reg_v'
    replace reg_v by reg_v'

If the instruction containing reg_v' hasn't been scanned by the register
allocator, when it happens, reg_v' will receive a physical register. You
must assign to reg_v' a weight such that is is not spilled again,
otherwise you may enter on an infinite loop, always spilling the same
spilled register.

Fernando

>
> So, as far as I understood live intervals with weight equal to HUGE_VAL are
> spilled and I don't need to allocate physical registers for them, right?
> Shoud hasStackSlot method of VirtRegMap return true for these intervals' reg
> members?
>



More information about the llvm-dev mailing list