<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">If you want to stay within the bounds of the existing register allocation architecture in llvm you should subclass from RegAllocBase and work from there. It basically has a LiveInterval structure (what you would find a linear scan allocator that allows holes in the liverange) for each virtual register, they are all put into a worklist and you pop them one by one and color, split and spill them. RegAllocBasic is about the simplest implementation of that you should read that code for understanding the concepts.</div><div class="">As for graph coloring, there is no code that builds interference graphs in llvm (interferences are checked on demand with the LiveRegMatrix instead). I'm not aware of any documentation outside the code (and maybe a few mailing list posts).</div><div class=""><br class=""></div><div class="">- Matthias</div><br class=""><div><blockquote type="cite" class=""><div class="">On May 20, 2015, at 2:18 PM, Natanael Ramos <<a href="mailto:naelr8@gmail.com" class="">naelr8@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I'm working on my project for completion undergraduate courses, consisting of an experimental analysis of registers allocation algorithms. For this task, I am using the set of tools from the LLVM project.<br class=""><br class="">However, I have read the documentation of the LLVM project and not yet found a way to put the pieces of the puzzle together. So far I know:<br class=""><br class=""><ul class=""><li class="">As passes work as engage them to LLVM and know I must implement MachineFunctionPass pass.</li></ul><br class=""><ul class=""><li class="">I follow some suggestions to look at the Basic Allocator code, but could not understand much.</li></ul><br class="">The allocator I intend to implement is based on graph coloring heuristics, as the theory of operation of such methods I’m well aware.<br class=""><br class="">So I look for is some sort of "How to", a defined set of steps to implement such allocator. It sounds like carelessness, but I have to deliver the work in about six months and I'm a little confused.<br class=""><br class="">If anyone can give me some guidance or reference to any supporting material (besides the own documentation), I would be grateful.<br class=""><br class="">My English may be a little wrong, I am a Brazilian student.<br class=""><br clear="all" class=""></div><br class="">-- <br class=""><div class="gmail_signature">Natanael Ramos <br class="">Membro do corpo discente de Ciência da Computação pelo Instituto Federal de <br class="">Minas Gerais - Campus Formiga<br class=""><br class=""></div>
</div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:LLVMdev@cs.uiuc.edu" class="">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" class="">http://llvm.cs.uiuc.edu</a><br class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br class=""></div></blockquote></div><br class=""></body></html>