[lldb-dev] 回复: Re: [LLVMdev] How Fast RegisterAllocation determine if the use-reference is the last use without isKill Flag
wansheg
wansheg at qq.com
Thu Nov 14 17:26:04 PST 2013
thank you,jakob.
Jakob Stoklund Olesen <stoklund at 2pi.dk>编写:
>
>On Nov 14, 2013, at 6:20 AM, sheng wang <wansheg at qq.com> wrote:
>
>> Hello llvmers:
>> I'm study Fast register allocation in codegen. I get confused
>> with isKill flag in MachineOperand. I thin "isKill" flag the last Use
>> Reference. But, Fast Register doesn't require LiveVariable Analysis which
>> will mark isKill Flag for global virtual Register. So during Fast
>> RegisterAllocation, Faster Register Allocation procedure can't determine if
>> this use-reference is the last use through current path ;
>>
>> , How does Fast RegisterAllocation resolve such problem ?
>
>It is using the use-def chain of the virtual register. Virtual registers are rewritten to physical registers in a top-down manner, and MachineRegisterInfo updates the use-def lists as operands are rewritten. When the last use of a virtual register is rewritten, its use-def chain becomes empty.
>
>This only works for local virtual registers, of course. If a virtual register has uses or refs in multiple basic blocks, it is always assumed to be live out of the block. The fast register allocator is optimized for debug builds where the code has almost no global virtual registers.
>
>Thanks,
>/jakob
>.
>
More information about the lldb-dev
mailing list