[LLVMdev] register scavenger

Arnold Schwaighofer arnold.schwaighofer at gmail.com
Sat Nov 10 16:39:33 PST 2012


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