<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-02-10 0:56 GMT-02:00 Matthias Braun <span dir="ltr"><<a href="mailto:matze@braunis.de" target="_blank">matze@braunis.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div>Interesting,</div><div><br></div><div>I don't think the document is in a shape for documentation that ships with llvm. Just some points:</div><div><br></div><div>- The document keeps jumping between general register allocation concepts, general llvm concepts and code snippets of llvms register allocators. It's hard to follow which is which.</div></div></blockquote><div><br><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">​I understand, the document needs improvement in the structure and organization to facilitate the reader's understanding and keep the reading flow concise.<br></div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div>- The basic concepts would need better and more in-depth descriptions, just to give some topics:</div><div>   - How does the basic program representation work, MachineInstr, MachineOperand (esp. the register kind with the undef, dead and kill flags), subregisters, subregisterindexes, register classes, how we express most constraints with register classes, virtual registers how register are encoded in unsigneds, a proper description of register units, what't does it mean if a register is reserved or allocatable, pristine registers, lanemasks, ...</div><div>   - How does the liveness representation work: What is a Segment, a <div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">​​</div>VNInfo, a SlotIndex, how can we maintain SSA form in the liveness info (and why do we do that)</div><div>   - How do all the regalloc related passes in llvm play together: PhiElimination, TwoAddress, RegisterCoalescer, RegAllocXXX, VirtRegRewriter</div></div></blockquote><div><br><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">​In this case I agree with Sean and Hal, I think that such information will fit better in the 'Register Allocation' section on the LLVM 'Target-Independent Code Generator' documentation​, in my opinion. <span id="result_box" class="" lang="en"><span class="">I</span> <span class="">would</span> <span class="">also</span> <span class="">need some help</span> <span class="">to document</span> <span class="">these more specific modules</span> <span class="">and </span><span class="">structures (like </span></span><span id="result_box" class="" lang="en"><span class="">​VNInfo for instance).<br><br></span></span></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline"><span id="result_box" class="" lang="en"><span class="">My focus in this tutorial was to document the steps to write a register allocator,</span></span><span id="result_box" class="" lang="en"><span class=""> the specifics of each class should be known previously or by reading the code of each class.<br><br></span></span></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div>On the other hand I applaud going through the work and actually writing something down, this will surely help other people who just want to get started with the matter. Maybe there is a way to get this up onto the llvm blog (who maintains that)?</div></div></blockquote><div><br><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">​<span id="result_box" class="" lang="en"><span class="">This was the main</span> <span class="">purpose</span> <span class="">when I wrote the</span> <span class="">tutorial,</span> <span class="">help</span> <span class="">people</span> <span class="">who just </span></span><span id="result_box" class="" lang="en"><span class="">want to</span> <span class="">write</span> <span class="">an register allocation using LLVM and don't want to find themselves digging deep in the LLVM source code</span><span class=""> to understand this process.</span></span>​</div><br><br><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">​I think that the blog is maintained by ​Alex Bradbury (<a href="mailto:asb@asbradbury.org">asb@asbradbury.org</a>).<br></div><br><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">​Thank you for the feedback Matthias, it's nice to have some suggestions on specific information ​about the register allocation pass also. <span id="result_box" class="" lang="en"><span class="">Many</span> <span class="">of the advances that</span> <span class="">I had in</span> <span class="">my project</span> <span class="">were</span> <span class="">due to your help and from other developers </span><span class=""></span> <span class="">on llvm-dev</span> <span class="">mailing list</span><span>.</span></span></div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><span class=""><font color="#888888"><div><br></div><div>- Matthias</div></font></span><div><div class="h5"><div><br></div><div><blockquote type="cite"><div>On Feb 9, 2016, at 6:18 PM, Sean Silva via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:</div><br><div><div dir="ltr">Matthias, it's rare that we get a substantial piece of documentation like this. Can you take a look at the content?</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 5, 2016 at 3:50 PM, Natanael Ramos via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif">Hello<br><br></div><div style="font-family:arial,helvetica,sans-serif">My name is Natanael Ramos, I'm a  student of bachelor degree on Computer Science Course, here on Brazil.<br><br></div><div style="font-family:arial,helvetica,sans-serif">Recently I have worked with LLVM for my undergraduate thesis (I don't really know how is called in other countries, here is called <span lang="en"><span>Completion of course work</span></span>), in my work I have implemented an register allocator using LLVM and have tested him with the built-in allocators in LLVM (Probably I'll publish a paper soon, if all goes as expected).<br><br></div><div style="font-family:arial,helvetica,sans-serif">As another product of my work, I have created a tutorial of how to write an LLVM register allocator, extending the RegAllocBase interface, this tutorial is based on my understanding of the LLVM framework for working with the register allocation pass.<br><br></div><div style="font-family:arial,helvetica,sans-serif">The tutorial have been written in reStructuredText following the LLVM instructions and orientations (<a href="http://www.llvm.org/docs/SphinxQuickstartTemplate.html" target="_blank">http://www.llvm.org/docs/SphinxQuickstartTemplate.html</a>). As it's suggested, I'm sending the tutorial to this mailing list<span lang="en"><span> in order to</span> <span>contribute to the community</span> <span>of</span> <span>developers,</span> <span>which</span> <span>use</span> <span>LLLVM.<br><br></span></span></div><div style="font-family:arial,helvetica,sans-serif"><span lang="en"><span>Any suggestions, please let me know.<span><font color="#888888"><br></font></span></span></span></div><span><font color="#888888"><div style="font-family:arial,helvetica,sans-serif"><span lang="en"><span></span></span></div><br>-- <br><div>Natanael Ramos <br>Membro do corpo discente de Ciência da Computação pelo Instituto Federal de <br>Minas Gerais - Campus Formiga<br><br></div>
</font></span></div>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>
_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br></div></blockquote></div><br></div></div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Natanael Ramos <br>Membro do corpo discente de Ciência da Computação pelo Instituto Federal de <br>Minas Gerais - Campus Formiga<br><br></div>
</div></div>