[LLVMdev] Named Register Implementation

Renato Golin renato.golin at linaro.org
Sat Mar 29 05:21:12 PDT 2014


On 29 March 2014 10:37, Joerg Sonnenberger <joerg at britannica.bec.de> wrote:
> I'd like to separate this into two different functionalities:

We will. But in reverse order.


> (1) Reserve registers, so that normal allocation won't use them.
> This can be done on a global or function level.

This is the most controversial part of the proposal and is the least
important to make all known cases work. I believe that having access
to registers in that way can only be explained by the inefficiency of
the compiler (for noticing that a register variable should not spill)
and could be easily changed to be a hard rule by a given flag, so that
register pressure still wouldn't spill the variable.

This is similar to named register, but with the additional benefit
that the compiler is free to choose the register, while in the second
case, the user does. It also would work with all standard C code
already available using the `register` keyword. But that's for another
discussion...


> (2) Provide intrinsincs to read/write a given register.

That's the idea right now. Just that. No guarantees. Aperture Labs
kind of science (not Black Mesa).

cheers,
--renato



More information about the llvm-dev mailing list