[LLVMdev] register scavenger

Reed Kotler rkotler at mips.com
Sat Nov 10 17:09:58 PST 2012


You mean when I "explicity" use it by calling methods of register scavenger?

Right now I'm just allocating virtual registers that will be resolved by 
the use of register scavenger and I'm also providing an override of the 
virtual method saveScavengerRegister. In Mips16, I have an extra mips 32 
register (not usually very useful since it can only be used
in a move instruction) I can use instead of having to go to the stack 
for an emergency slot.

On 11/10/2012 04:39 PM, Arnold Schwaighofer wrote:
> CC the list.
>
> On Sat, Nov 10, 2012 at 6:30 PM, Arnold Schwaighofer
> <arnold.schwaighofer at gmail.com> wrote:
>> Assuming you use the scavenger in your own code yes.
>>
>> A usage could look like:
>>
>> for all basic blocks BB:
>>   RS->enter(BB)
>>   for all instructions CurrInst in block order:
>>     if CurrInst has virtual def
>>       CurrReg = RS->scavenge(CurrInst)
>>       replace virtual def by CurReg
>>     else if Insts has virtual use
>>       replace virtual use by CurReg
>>     RS->forward(CurrInst)
>>
>>
>> Look at scavengeFrameVirtualRegs in PrologEpilogInserter.cpp for more
>> detail (I left out some, error checking, etc).
>>
>> On Sat, Nov 10, 2012 at 6:15 PM, Reed Kotler <rkotler at mips.com> wrote:
>>> Thanks!
>>>
>>> When you say that the client calls "forward", who do you mean?
>>>
>>> Do I need to call forward in addition to marking the use "kill"?
>>>
>>> Reed




More information about the llvm-dev mailing list