[LLVMdev] Supporting pre-allocated registers in LLVM

nkavv at physics.auth.gr nkavv at physics.auth.gr
Sat Oct 6 18:11:58 PDT 2007


>> You mean a temporary defined in an instruction. OK, that is what i
>> basically
>> need here. Is it guaranteed to "live" in the physical register for
>> the entire
>> program (or at least for a single function, which would trivially
>> work for
>> single-function programs)?

>No it's just guaranteed to be defined in a fixed register. The
>allocator is free to copy it to another register, spill it to stack.
>It all depends on proximity of uses and overall register pressure.
>
>Evan

I'm afraid you are right, based on what i'm reading from the Register Allocation
section in the manuals. What i had in mind was that this would be possible: to
associate a temporary to a hard register for its entire lifetime, disabling
spills and coalescing. Of course, in extreme cases where a coloring cannot be
accomplished, the allocator would report the allocation as infeasible and stop.
It could be provided as user option; it makes sense for embedded systems with
asymmetrical storage resources (some of the registers are distributed and some
are placed in usual register files).

Could this be done in a more LLVM-friendly way? Is there any port defining
strange registers (like an accumulator or the HI,LO registers of a
MIPS-compatible)?

Nikolaos Kavvadias




More information about the llvm-dev mailing list