<div dir="rtl"><div dir="ltr">OS is Windows 7 64 bit OS, compiler is 32 bit Visual C++ 2012 with 32 bit.</div><div dir="ltr">The target which is i686-pc-mingw32-elf so I can use the ELF dynamic loader. </div><div dir="ltr">
Code model, relocation model and and memory manager are whatever default for this - did not modify.</div><div dir="ltr"><br></div><div dir="ltr">The Module comes from clang. The source is 1000 or more lines repeating C++ code in one big function:</div>
<div dir="ltr"><br></div><div dir="ltr"><div dir="ltr"><font face="courier new, monospace"> A+1;</font></div><div dir="ltr"><font face="courier new, monospace"> A*B.t();</font></div><div><br></div><div>where A and B are matrices from Armadillo <a href="http://arma.sourceforge.net/" target="_blank">http://arma.sourceforge.net/</a>. This a stress and performance test due to the large number of EH and temporary objects created.</div>
<div><br></div></div><div dir="ltr">I am using the Engine Builder and MCJIT unmodified (except the multi-modules patches which are not relevant as there is only one module) like this:</div><div dir="ltr"><br></div><div dir="ltr">
<div dir="ltr"><font face="courier new, monospace"> OwningPtr<llvm::ExecutionEngine> EE(llvm::EngineBuilder(M)</font></div><div dir="ltr"><font face="courier new, monospace"> .setErrorStr(&Error)</font></div>
<div dir="ltr"><font face="courier new, monospace"> .setUseMCJIT(true)</font></div><div dir="ltr"><font face="courier new, monospace"> .create());<br>
</font></div><div><br></div><div>to run the function either <br></div><div><br></div><div><div><font face="courier new, monospace"> llvm::Function *F = M->getFunction(Name);</font></div><div><font face="courier new, monospace"> void *FN = EE->getPointerToFunction(F);</font></div>
</div><div>or<br></div><div><div><font face="courier new, monospace"> uint64_t FN = EE->getFunctionAddress(Name);</font></div></div><div><br></div><div>followed by </div><div><br></div><div><font face="courier new, monospace"> ((void (*)())FN)();<br>
</font></div><div>or</div><div><div><font face="courier new, monospace"> EE->runFunction(F, std::vector<llvm::GenericValue>());</font></div></div><div><br></div><div>all work the same with smaller about 1000 lines of the above code module and crash the same with more code. The call stack is unhelpful Visual C++ says: Frames below may be incorrect and/or missing which indicates a real problem with it. I have tried to provide less stack space (default is 10M) for the compiled program without any change.</div>
<div><br></div><div>Yaron</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div dir="ltr">2013/10/22 Kaylor, Andrew <span dir="ltr"><<a href="mailto:andrew.kaylor@intel.com" target="_blank">andrew.kaylor@intel.com</a>></span></div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I’m not aware of such a limitation.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">What architecture, code model and relocation model are you using? Are you using the SectionMemoryManager?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">-Andy<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Yaron Keren [mailto:<a href="mailto:yaron.keren@gmail.com" target="_blank">yaron.keren@gmail.com</a>]
<br>
<b>Sent:</b> Tuesday, October 22, 2013 8:12 AM<br>
<b>To:</b> <<a href="mailto:llvmdev@cs.uiuc.edu" target="_blank">llvmdev@cs.uiuc.edu</a>>; Kaylor, Andrew<br>
<b>Subject:</b> Size limitations in MCJIT / ELF Dynamic Linker/ ELF codegen?<u></u><u></u></span></p><div><div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">I'm running in MCJIT a module generated from one C++ function. Every line of the source function uses C++ classes and may throw an exception. As long as there are less than (about) 1000 lines, everything works. With more lines the compiled
code crashes when running it, with no sensible stack trace.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Is there any kind of hard-coded size limitation in MCJIT / ELF Dynamic Linker / ELF codegen / number of EH states in a function ? <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I did browse the code but could not find anything obvious. <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Yaron<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div></div></div>
</div>
</blockquote></div><br></div></div>