Alex S
2014-Aug-21 15:54 UTC
[LLVMdev] Liveness information still usable after register allocation?
Hi all, Sorry to bother those not interested in this problem. I have a problem while I want to reuse the liveness information after register allocation. When I use the livein_begin() from MachineBasicBlock to get the live-in registers after register alloction. I found that the liveness information is sometime incorrect. For example, some registers should be live-in to the machine basic block as these registers are upward exposed in this machine basic block. Therefore, I wonder whether there are any liveness analysis available after register allocation. Or, did I misunderstand it? Thanks, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140821/918e147e/attachment.html>
Jonathan Roelofs
2014-Aug-21 16:11 UTC
[LLVMdev] Liveness information still usable after register allocation?
On 8/21/14, 9:54 AM, Alex S wrote:> Hi all, > > Sorry to bother those not interested in this problem. > > I have a problem while I want to reuse the liveness information after register > allocation. > When I use the livein_begin() from MachineBasicBlock to get the live-in > registers after > register alloction. I found that the liveness information is sometime incorrect. > For example, > some registers should be live-in to the machine basic block as these registers > are upward exposed > in this machine basic block. > > Therefore, I wonder whether there are any liveness analysis available after > register allocation. > Or, did I misunderstand it?I was looking for post-RA liveness the other day and ran into: MachineBasicBlock::computeRegisterLiveness, does it do what you want? The neighborhood thing seemed a bit wonky for what I needed at the time, so I didn't end up using it, and in turn pursued a different solution to my problem that didn't need post-RA liveness (I'd need the neighborhood to be the whole basic block, and that seemed a bit awkward). HTH, Jon> > Thanks, > Alex > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-- Jon Roelofs jonathan at codesourcery.com CodeSourcery / Mentor Embedded
Alex S
2014-Aug-21 17:15 UTC
[LLVMdev] Liveness information still usable after register allocation?
Hi Jonathan, Thanks for your advice. It seems that the implementation of MachineBasicBlock::computeRegisterLiveness is limited to one MachineBasicBlock. If I want to get Live-in registers after register allocation, using the method you mentioned, I have to do the data flow analysis for the whole program. Is that correct? Again thanks for your help! Best regards, Alex On Thu, Aug 21, 2014 at 12:11 PM, Jonathan Roelofs < jonathan at codesourcery.com> wrote:> > > On 8/21/14, 9:54 AM, Alex S wrote: > >> Hi all, >> >> Sorry to bother those not interested in this problem. >> >> I have a problem while I want to reuse the liveness information after >> register >> allocation. >> When I use the livein_begin() from MachineBasicBlock to get the live-in >> registers after >> register alloction. I found that the liveness information is sometime >> incorrect. >> For example, >> some registers should be live-in to the machine basic block as these >> registers >> are upward exposed >> in this machine basic block. >> >> Therefore, I wonder whether there are any liveness analysis available >> after >> register allocation. >> Or, did I misunderstand it? >> > I was looking for post-RA liveness the other day and ran into: > MachineBasicBlock::computeRegisterLiveness, does it do what you want? > > The neighborhood thing seemed a bit wonky for what I needed at the time, > so I didn't end up using it, and in turn pursued a different solution to my > problem that didn't need post-RA liveness (I'd need the neighborhood to be > the whole basic block, and that seemed a bit awkward). > > > HTH, > > Jon > >> >> Thanks, >> Alex >> >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> > -- > Jon Roelofs > jonathan at codesourcery.com > CodeSourcery / Mentor Embedded >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140821/30a94bc7/attachment.html>
Iain Sandoe
2014-Aug-21 17:18 UTC
[LLVMdev] Liveness information still usable after register allocation?
On 21 Aug 2014, at 17:11, Jonathan Roelofs wrote:> > > On 8/21/14, 9:54 AM, Alex S wrote: >> Hi all, >> >> Sorry to bother those not interested in this problem. >> >> I have a problem while I want to reuse the liveness information after register >> allocation. >> When I use the livein_begin() from MachineBasicBlock to get the live-in >> registers after >> register alloction. I found that the liveness information is sometime incorrect. >> For example, >> some registers should be live-in to the machine basic block as these registers >> are upward exposed >> in this machine basic block. >> >> Therefore, I wonder whether there are any liveness analysis available after >> register allocation. >> Or, did I misunderstand it? > I was looking for post-RA liveness the other day and ran into: MachineBasicBlock::computeRegisterLiveness, does it do what you want? > > The neighborhood thing seemed a bit wonky for what I needed at the time, so I didn't end up using it, and in turn pursued a different solution to my problem that didn't need post-RA liveness (I'd need the neighborhood to be the whole basic block, and that seemed a bit awkward).you might also want to look at TargetRegisterInfo::trackLivenessAfterRegAlloc(). Iain> > HTH, > > Jon >> >> Thanks, >> Alex >> >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> > > -- > Jon Roelofs > jonathan at codesourcery.com > CodeSourcery / Mentor Embedded > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev