[LLVMdev] request for help writing a register allocator
Chris Lattner
clattner at apple.com
Mon Oct 19 21:34:33 PDT 2009
On Oct 19, 2009, at 7:28 PM, Lang Hames wrote:
> Hi Susan,
>
> You may find the PBQP allocator implementation useful as a reference
> to what's involved in adding a new allocator to LLVM. It's located in
> lib/CodeGen/RegAllocPBQP.cpp, with supporting files in the lib/
> CodeGen/
> PBQP directory.
>
> Yes - as far as working allocators go PBQP is pretty simple. If
> you're just interested in LLVM API details you can focus on the
> lower half of the RegAllocPBQP.cpp source file (everything from
> PBQPRegAlloc::findVRegIntervalsToAlloc()). The rest of the source
> (class declaration at the top of RegAllocPBQP.cpp aside) is mostly
> concerned with PBQP algorithm specifics, such as constructing cost
> matrices, or carrying out the PBQP graph reduction algorithm.
Other advice: if you're looking to simplify this for students, I'd
recommend staying away from X86 or ARM, which use subregs heavily. If
you work with (e.g.) the sparc backend, you can avoid them completely,
simplifying the problem.
-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20091019/d3cb91f1/attachment.html>
More information about the llvm-dev
mailing list