On 11/23/07, Fernando Magno Quintao Pereira <fernando at cs.ucla.edu> wrote:> > > Hi, Sanjiv, > > those passes operate on the whole machine function. Each machine > function contains many basic blocks. If a program has many functions, the > register allocator will be called as many times, i.e it does not do > interprocedural allocation. > > best, > > FernandoThanks for replying back. I am looking to write a regalloc pass that does interprocedural regalloc. By constructing a Call Graph and keeping the registers in a single call chain different so that i can avoid spilling (saving) across function calls. What will be the right place to do so? Sanjiv> As far as I understand , the regalloc passes provided operate on basic > block > > level? > > Is there anything that operate on the whole Module? > > > > Thx, > > Sanjiv > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20071123/ee0abc75/attachment.html>
Fernando Magno Quintao Pereira
2007-Nov-23 17:59 UTC
[LLVMdev] global register allocation.
Hi, again, I think you can do it in the same way that the other allocators have been coded, i.e extend RA, register the pass and so forth. I am not sure about the best way to pass information among a run of RegAlloc to the other, maybe the other guys in the list could suggest something. Yet, you can always dump it into a file, and read it again, everytime it is necessary. Remember that RegAlloc will be called once per function. Also, LLVM does very aggressive inlining of method calls, and this may cause the benefits of interprocedural register allocation to be very small, if any. There was one guy (google for Philip Brisk) who was working with interprocedural RA on SSA-form programs. best, Fernando> On 11/23/07, Fernando Magno Quintao Pereira <fernando at cs.ucla.edu> wrote: >> >> >> Hi, Sanjiv, >> >> those passes operate on the whole machine function. Each machine >> function contains many basic blocks. If a program has many functions, the >> register allocator will be called as many times, i.e it does not do >> interprocedural allocation. >> >> best, >> >> Fernando > > > Thanks for replying back. > I am looking to write a regalloc pass that does interprocedural regalloc. > By constructing a Call Graph and keeping the registers in a single call > chain different so that i can avoid spilling (saving) across function calls. > What will be the right place to do so? > > Sanjiv > >> As far as I understand , the regalloc passes provided operate on basic >> block >>> level? >>> Is there anything that operate on the whole Module? >>> >>> Thx, >>> Sanjiv >>> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >
Thanks again. One more question here: Since the regalloc works once per function, do I stil have access to the Call graph? Just saving information between regalloc passes for different functions may not be enough for my case. I will need to maintain the regalloc info of various passes in the call graph order. Anyways thanks for your inputs. I will get back if I need to learn more. Sanjiv On Nov 23, 2007 11:29 PM, Fernando Magno Quintao Pereira <fernando at cs.ucla.edu> wrote:> > Hi, again, > > I think you can do it in the same way that the other allocators have > been coded, i.e extend RA, register the pass and so forth. I am not sure > about the best way to pass information among a run of RegAlloc to the > other, maybe the other guys in the list could suggest something. Yet, you > can always dump it into a file, and read it again, everytime it is > necessary. Remember that RegAlloc will be called once per function. Also, > LLVM does very aggressive inlining of method calls, and this may cause the > benefits of interprocedural register allocation to be very small, if any. > There was one guy (google for Philip Brisk) who was working with > interprocedural RA on SSA-form programs. > > best, > > Fernando > > > > On 11/23/07, Fernando Magno Quintao Pereira <fernando at cs.ucla.edu> wrote: > >> > >> > >> Hi, Sanjiv, > >> > >> those passes operate on the whole machine function. Each machine > >> function contains many basic blocks. If a program has many functions, the > >> register allocator will be called as many times, i.e it does not do > >> interprocedural allocation. > >> > >> best, > >> > >> Fernando > > > > > > Thanks for replying back. > > I am looking to write a regalloc pass that does interprocedural regalloc. > > By constructing a Call Graph and keeping the registers in a single call > > chain different so that i can avoid spilling (saving) across function calls. > > What will be the right place to do so? > > > > Sanjiv > > > >> As far as I understand , the regalloc passes provided operate on basic > >> block > >>> level? > >>> Is there anything that operate on the whole Module? > >>> > >>> Thx, > >>> Sanjiv > >>> > >> _______________________________________________ > >> LLVM Developers mailing list > >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >> > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >