There are three main register allocation strategies in the backend of LLVM. If I want to design and implement a new algorithm, how can I add it to LLVM and call it from llc just as the three options like llc -regalloc=fast file.bc -o fa.sllc -regalloc=new file.bc -o new.s -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140522/b80987c6/attachment.html>
Tim Northover
2014-May-22 06:33 UTC
[LLVMdev] How to construct a new register allocation algorithm
On 22 May 2014 02:37, 蜡笔小新 <841224078 at qq.com> wrote:> There are three main register allocation strategies in the backend of LLVM. > If I want to design and implement a new algorithm, how can I add it to LLVM > and call it from llc just as the three options likeIt's probably easiest to copy one of the existing allocators and replace its code with yours. For example lib/CodeGen/RegAllocBasic.cpp is the smallest.> llc -regalloc=fast file.bc -o fa.sThis particular option seems to be handled by the "RegisterRegAlloc" declarations in each file. Cheers. Tim.
TheMask
2014-May-22 19:56 UTC
[LLVMdev] How to construct a new register allocation algorithm
Just out curiosity, have you implemented a new register allocation algorithm and if so, which one? I'm working on code generator right now and I'm looking for a simple register allocation algorithm to implement and how to deal with fixed registers to cetain instructions like eax/ebx to mul/div on x86. I've asked this before (http://llvm.1065342.n5.nabble.com/How-do-I-deal-with-fixed-registers-td68697.html) but no one asnwered yet. -- View this message in context: http://llvm.1065342.n5.nabble.com/How-to-construct-a-new-register-allocation-algorithm-tp68774p68786.html Sent from the LLVM - Dev mailing list archive at Nabble.com.