<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 20, 2017, at 11:14 AM, Gaetano Checinski via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">As far as i know, optimizations can only be done on a module level.<div class="">If you compile and pass modules to the object-linking-layer, you won't be able to perform any optimizations.</div><div class="">Thus, what you could do is:<br class="">- merge the generated modules into a big monolithic module</div><div class="">- repeatedly perform optimization passes eg. inlining</div><div class="">- copy new functions into a new module ( so you don't re-compile and re-link the same functions)</div><div class="">- compile and link new module</div></div></div></blockquote><div><br class=""></div><div>This seems fragile to me: it could break with optimizations unless you mark everything such that the optimizer does not do any inter-procedural optimizations (other than inlining).</div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div><div><br class=""></div><div><br class=""></div><div><br class=""></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class=""><br class=""></div><img width="0" height="0" class="mailtrack-img" src="https://mailtrack.io/trace/mail/891a1a84af623a4c722c5c3d503d62c16d6607e8.png?u=931501"></div><div class="gmail_extra"><br class=""><div class="gmail_quote">2017-02-20 17:44 GMT+00:00 Christian Schafmeister via llvm-dev <span dir="ltr" class=""><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>></span>:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class="">Is it possible to inline functions compiled from C++ code into generated code that is fed, Module by Module, into the ORC JIT?</div><div class=""><br class=""></div><div class="">I'd like to add a Module compiled from C++ code into the JIT and then as I add later modules, functions from the first module are inlined in the later ones.</div><div class=""><br class=""></div><div class="">I already do this for file compilation/linking in my Common Lisp compiler “Clasp” (<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__github.com_drmeister_clasp&d=DwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=sSykZW5nIEBIoQEQoyEQF3iTvIwIffdEAf9FkbyVYz0&s=ao0EQZ_k7esDdMap8YjoO52BiKyMRHBv7PG4XJdrBOc&e=" target="_blank" class="">github.com/drmeister/clasp</a>).</div><div class=""><br class=""></div><div class="">I have followed the new ORC Kaleidoscope demo and set up the ORC layers to do optimization and compilation but the examples are all for function optimization and do not describe inlining.</div><div class=""><br class=""></div><div class="">Christian Schafmeister</div><div class=""><div style="word-wrap:break-word" class=""><div class="">Professor, Chemistry Department</div><div class="">Temple University</div><div class=""><a href="mailto:meister@temple.edu" target="_blank" class="">meister@temple.edu</a></div></div></div></div><br class="">______________________________<wbr class="">_________________<br class="">
LLVM Developers mailing list<br class="">
<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/llvm-dev</a><br class="">
<br class=""></blockquote></div><br class=""></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></body></html>