<div dir="ltr">Actually, The object cache holds the optimized IR (It's precompiled with optimizations and persist it). There's around of 10% of "on-the-fly" generated code that would go without the optimization. I Did test with optimization, and it was slower. For that 10% I'm okay with optimization being turned off.<div><br></div><div>I also only generate the function prototype for cached modules to reduce IR generation.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 20, 2016 at 6:20 PM, Mehdi Amini <span dir="ltr"><<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><span class=""><blockquote type="cite"><div>On Dec 20, 2016, at 9:13 AM, koffie drinker via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="m_-6171692098525338871Apple-interchange-newline"><div><div dir="ltr">Hi,<div><br></div><div>I'm trying to speed up the JIT time with llvm (3.9.1).</div><div>So far i've implemented the object cache, used FastISel and disabled optimizations.</div></div></div></blockquote><div><br></div></span><div>I can’t help with the rest, but just wanted to mention that totally disabling the IR optimizations is not necessarily a good idea depending on what does the input IR looks like: some of the optimizations can be “lightweight” and simplify the IR / delete dead core, making the compile-time actually faster.</div><div><br></div><div>— </div><div>Mehdi</div><span class=""><div><br></div><br><blockquote type="cite"><div><div dir="ltr"><div>Jit time is still too slow for my purpose (I do have a lot of code to Jit).</div></div></div></blockquote></span><blockquote type="cite"><div><span class=""><div dir="ltr"><div><br></div><div><a href="http://llvm.org/docs/ProgrammersManual.html#threads-and-the-jit" target="_blank">http://llvm.org/docs/<wbr>ProgrammersManual.html#<wbr>threads-and-the-jit</a> states that we can invoke <span style="font-family:consolas,'deja vu sans mono','bitstream vera sans mono',monospace;font-size:13px">ExecutionEngine::<wbr>getPointerToFunction()</span> <wbr>concurrently. This function was replaced by <span style="font-family:consolas,'deja vu sans mono','bitstream vera sans mono',monospace;font-size:13px">ExecutionEngine::<wbr>getFunctionAddress(). </span>Is this function also thread safe?</div><div><br></div><div>I want to speed up codegen by invoking parallel calls to getfunctionaddress(). Currently due the the large amount of code that has to be Jitted, the getfunctionaddress() takes around 40% of my load time.</div><div><br></div><div>What is meant with "<span style="font-family:'lucida grande','lucida sans unicode',geneva,verdana,sans-serif;font-size:14px">he user must still ensure that only one thread accesses IR in a given </span><code class="m_-6171692098525338871gmail-literal m_-6171692098525338871gmail-docutils" style="font-family:consolas,'deja vu sans mono','bitstream vera sans mono',monospace;font-size:0.95em"><span class="m_-6171692098525338871gmail-pre">LLVMContext</span></code><span style="font-family:'lucida grande','lucida sans unicode',geneva,verdana,sans-serif;font-size:14px"> while another thread might be modifying it" ?</span></div><div><span style="font-family:'lucida grande','lucida sans unicode',geneva,verdana,sans-serif;font-size:14px"><br></span></div><div><span style="font-family:'lucida grande','lucida sans unicode',geneva,verdana,sans-serif;font-size:14px">If I pre-generate all IR, and before execution, invoke the parallel getfunctionaddress() I should be fine right ? Since IR won't be modified anymore.</span></div><div><span style="font-family:'lucida grande','lucida sans unicode',geneva,verdana,sans-serif;font-size:14px"><br></span></div><div><font face="lucida grande, lucida sans unicode, geneva, verdana, sans-serif"><span style="font-size:14px">Cheers,</span></font></div></div></span>
______________________________<wbr>_________________<br>LLVM Developers mailing list<br><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br></div></blockquote></div><br></div></blockquote></div><br></div>