<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Jan 30, 2017 at 6:34 AM mats petersson via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg">On 30 January 2017 at 10:37, Siddharth Shankar Swain via llvm-dev <span dir="ltr" class="gmail_msg"><<a href="mailto:llvm-dev@lists.llvm.org" class="gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br class="gmail_msg"><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg"><div class="gmail_msg">When to JIT from AST and when to JIT from LLVM IR? What is the logic behind extreme laziness? In what situations can it be beneficial and in what it is not? Does it depends on target architecture?<span class="m_-8579785916863659985gmail-HOEnZb gmail_msg"><font color="#888888" class="gmail_msg"><br class="gmail_msg"></font></span></div></div></blockquote></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg"><br class="gmail_msg">I've quite possibly misunderstodd the question, but as far as I know, you have to generate IR to use LLVM's JIT functionality.<br class="gmail_msg"></div></div></div></div></blockquote><div><br></div><div>I think Siddharth is asking about when to defer IR generation and when not to.<br><br>The Kaleidoscope ORC JIT examples demonstrate the possibility of deferring IR generation until the moment that function is needed - rather than generating all the IR up front for a given script/source file/etc.<br><br>So the question is what tradeoffs might there be in taking advantage of that flexibility/possibility.<br><br>Really hard to say - as with many optimization problems - there could be cache effects that mean visiting all the AST and generating all the IR up front is better than generating fragments of IR from AST on an as-needed basis.<br><br>Chances are, in the end, I expect the 'right' answer is going to be a chunking conversion - where it's not one function at a time and not whole, large programs in one go, but a good "chunk" of the program to minimize the constant overheads of building a new module, walking your AST, etc.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Since this is probably an "XY question", it would help if you explain what you actually want to do.<br class="gmail_msg"><br class="gmail_msg">--<br class="gmail_msg"></div><div class="gmail_msg">Mats <br class="gmail_msg"></div></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><span class="m_-8579785916863659985gmail-HOEnZb gmail_msg"><font color="#888888" class="gmail_msg"><br class="gmail_msg"></font></span></div><span class="m_-8579785916863659985gmail-HOEnZb gmail_msg"><font color="#888888" class="gmail_msg">Siddharth<br class="gmail_msg"></font></span></div>
<br class="gmail_msg">_______________________________________________<br class="gmail_msg">
LLVM Developers mailing list<br class="gmail_msg">
<a href="mailto:llvm-dev@lists.llvm.org" class="gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a><br class="gmail_msg">
<a rel="noreferrer" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="gmail_msg">
<br class="gmail_msg"></blockquote></div></div></div>
_______________________________________________<br class="gmail_msg">
LLVM Developers mailing list<br class="gmail_msg">
<a href="mailto:llvm-dev@lists.llvm.org" class="gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="gmail_msg">
</blockquote></div></div>