<div dir="ltr">Ok, so I've reworked it to have one jit/context per expression. It uses a lot of memory.<div>Is there a way to clone/get the jitted mem after getfunctionaddress() invocation ? If I oculd get the size, I could do a memcpy on the address, and delete the jit. This should save a lot of memory.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 22, 2016 at 9:18 AM, koffie drinker <span dir="ltr"><<a href="mailto:gekkekoe@gmail.com" target="_blank">gekkekoe@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">So I've made code to invoke the getfunctionaddress() in parallel. I did verify that the code was good, by substituting <wbr>getfunctionaddress() with a bunch bogus computations. <div><br></div><div>It seems that the code with getfunctionaddress() is being serialized. Is there a giant lock somewhere per executionengine?<div>I have one execution engine that holds all the modules. Going through the llvm-dev list archives, it seems that I have to have a execution engine per module. Is this still the case ? (the posting were quite old). Is there a difference between mcjit and orc in this case?</div><div><br></div><div>I was hoping that by not modifying IR during getfunctionaddress() would work :(</div><div><br></div><div>Cheers,</div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 20, 2016 at 6:13 PM, koffie drinker <span dir="ltr"><<a href="mailto:gekkekoe@gmail.com" target="_blank">gekkekoe@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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>Jit time is still too slow for my purpose (I do have a lot of code to Jit).</div><div><br></div><div><a href="http://llvm.org/docs/ProgrammersManual.html#threads-and-the-jit" target="_blank">http://llvm.org/docs/Programme<wbr>rsManual.html#threads-and-the-<wbr>jit</a> states that we can invoke <span style="color:rgb(0,0,0);font-family:consolas,'deja vu sans mono','bitstream vera sans mono',monospace;font-size:13px">ExecutionEngine::getPoi<wbr>nterToFunction()</span> concurrently. This function was replaced by <span style="color:rgb(0,0,0);font-family:consolas,'deja vu sans mono','bitstream vera sans mono',monospace;font-size:13px">ExecutionEngine::getFunctio<wbr>nAddress(). </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="color:rgb(0,0,0);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_-4527745843314285584m_-4600735927633796910gmail-docutils m_-4527745843314285584m_-4600735927633796910gmail-literal" style="font-family:consolas,'deja vu sans mono','bitstream vera sans mono',monospace;font-size:0.95em;color:rgb(0,0,0)"><span class="m_-4527745843314285584m_-4600735927633796910gmail-pre">LLVMContext</span></code><span style="color:rgb(0,0,0);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="color:rgb(0,0,0);font-family:'lucida grande','lucida sans unicode',geneva,verdana,sans-serif;font-size:14px"><br></span></div><div><span style="color:rgb(0,0,0);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="color:rgb(0,0,0);font-family:'lucida grande','lucida sans unicode',geneva,verdana,sans-serif;font-size:14px"><br></span></div><div><font color="#000000" face="lucida grande, lucida sans unicode, geneva, verdana, sans-serif"><span style="font-size:14px">Cheers,</span></font></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>