sheng wang
2013-Nov-14 14:20 UTC
[LLVMdev] How Fast RegisterAllocation determine if the use-reference is the last use without isKill Flag
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 ? -- View this message in context: http://llvm.1065342.n5.nabble.com/How-Fast-RegisterAllocation-determine-if-the-use-reference-is-the-last-use-without-isKill-Flag-tp63316.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
Jakob Stoklund Olesen
2013-Nov-14 18:24 UTC
[LLVMdev] How Fast RegisterAllocation determine if the use-reference is the last use without isKill Flag
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
Apparently Analagous Threads
- [LLVMdev] How to determine the a use reference is the last reference of a virtual Register through current path
- [LLVMdev] <IsKill> getting from MachineOperand is just <Used> attribute from logic.
- [LLVMdev] <IsKill> getting from MachineOperand is just <Used> attribute from logic.
- IsDead, IsKill
- IsDead, IsKill