<div dir="ltr">Hi Philip,<div><br></div><div>Thanks for your great list of ideas for the document!  </div><div><br></div><div>I don't really have a scope for the document beyond: If it something that requires mapping from high-level to LLVM IR, I think it should go into the document.  I started out using C++ examples because  many people know C++.  I am personally mostly an advocate of statically checked languages but I don't see that as a reason to not include information of relevance to non-statically checked languages.   As for garbage collection, well, more and more languages are making use of that so I think it is highly relevant to the document.  I think all of the issues you have mentioned belong in this document, although I am not sure I'll be the best to write all of the document.  I sort of hope that everybody will add their pieces so that we get a huge document that addresses nearly all the needs of somebody who is going to start on or be using LLVM IR.</div>
<div><br></div><div>You are all more than welcome to branch the document at GitHub, add your corrections and even entire chapters, and I'll be happy to merge it all back to a single document.</div><div><br></div><div>
<br></div><div>-- Mikael</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/12/2 Philip Reames <span dir="ltr"><<a href="mailto:listmail@philipreames.com" target="_blank">listmail@philipreames.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 11/28/13 6:07 PM, Mikael Lyngvig wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
It will probably take a few weeks or a month before the "Mapping High-Level Constructs to LLVM IR" document is ready for prime time.  Until then, you can review and study it at this URL:<br>
<br>
<a href="https://github.com/archfrog/llvm-doc/blob/master/MappingHighLevelConstructsToLLVMIR.rst" target="_blank">https://github.com/archfrog/<u></u>llvm-doc/blob/master/<u></u>MappingHighLevelConstructsToLL<u></u>VMIR.rst</a><br>

<br>
<br>
Please notice that I specifically do not advocate reviewing the document for a week or two.  But feel free to give me any feedback, comments, and criticism that you may have to share.<br>
<br>
Once the document has been finalized and comitted to LLVM, I'll delete the repository at Github - or, perhaps even better, simply make a small page that refers to the official copy in LLVM.<br>
</blockquote>
Just want to comment that I strongly approve of your intended goal. Depending on how my time shakes out over the next few weeks, I may even take some time to write up my own experiences.  I particularly like how you have chosen to layout various alternative implementations rather than choosing "one true implementation".<br>

<br>
A few areas you haven't covered and might want to consider:<br>
- How to enable debug information?  (Line and Function, Variable)<br>
- How to interface with a garbage collector? (link to existing docs)<br>
- How to express a custom calling convention? (link to existing docs)<br>
- Representing constructors, destructors, finalization<br>
- How to examine the stack at runtime?  How to modify it?  (i.e. reflection, interjection)<br>
- Representing subtyping checks (with full alias info), TBAA, struct-path TBAA<br>
- How to exploit inlining (external, vs within LLVM)?<br>
- How to express array bounds checks for best optimization?<br>
- How to express null pointer checks?<br>
- How to express domain specific optimizations?  (i.e. lock elision, or matrix math simplification) (link to existing docs)<br>
- How to optimize call dispatch or field access in dynamic languages? (ref new patchpoint intrinsics for inline call caching and field access caching)<br>
<br>
Out of curiosity, what do you see as the intended scope of this document?  I see there being three main categories of languages: pure static compilation, "managed languages" (i.e. compile to bytecode + runtime system), and pure dynamic languages*.  I could see different features and focus for a document geared at each of these camps.  For example, the first two are going to be interested in static optimization, whereas the last two are going to be interested in speculative optimization.   What are your thoughts on this?<br>

<br>
* Note: Let's not get too caught up in the categorization.  It's not really important where exactly the lines are drawn.<br>
<br>
Philip<br>
______________________________<u></u>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvmdev</a><br>
</blockquote></div><br></div>