[LLVMdev] Conceptual difference between "Unallocatable" and "Reserved" registers.

Lei Mou lei.mou.uu at gmail.com
Tue Apr 17 22:04:35 PDT 2012


Hi Aries,

Thank you for your reply. I understand that the registers you mentioned
should not be used at will. The problem I don't understand is why not make
these registers *unallocatable*. Since in X86RegisterInfo.td, only floating
point stack registers ST0 to ST7 and status flag registers are defined as
not allocatable, while special registers such as ESP/EIP/EBP are defined as
*allocatable but reserved *(in X86RegisterInfo.cpp).

Since these registers also have special usage, why not specify them as
*unallocatable,
instead of allocatable but reserved?* I hope I made myself clear. Thanks.

Regards,
Lei Mou

On Wed, Apr 18, 2012 at 12:38 PM, AriesWu <dodohack at gmail.com> wrote:

> such as sp, fp for x86 are reserved registers, it means you should not use
> it as general purpose.
>
> On 18 April 2012 12:09, Lei Mou <lei.mou.uu at gmail.com> wrote:
>
>> Hi,
>>
>> I'm writing to ask the differences between a "reserved" register and an
>> "unallocable" register. In X86 backend, for example, the stack pointer
>> register and instruction pointer are reserved but allocatable. In the
>> Doxygen document of function llvm::TargetRegisterInfo::getReservedRegs,
>> it says that a reserved register is one that *has particular uses and
>> should be considered unavailable at all times. *If it is unavailable at
>> all times, why not make such a reserved register unallocatable? Thanks!
>>
>> Regards,
>> Lei Mou
>>
>>
>>
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
>>
>
>
> --
> Sincerely,
>
> Aries Wu
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120418/fc84020f/attachment.html>


More information about the llvm-dev mailing list