<div dir="ltr">Hi Lang,<div><br></div><div>For my information, Am I enabling it correctly?</div><div><br></div><div><div><span class="" style="white-space:pre">                  </span>llvm::TargetOptions TO;</div><div><span class="" style="white-space:pre">                    </span>TO.EnableFastISel = true;</div><div><br></div><div><span class="" style="white-space:pre">                 </span>std::string ErrStr;</div><div><span class="" style="white-space:pre">                        </span>engine = std::unique_ptr<llvm::ExecutionEngine>(llvm::EngineBuilder(std::move(sysModuleOwner))</div><div><span class="" style="white-space:pre">                               </span>.setErrorStr(&ErrStr)</div><div><span class="" style="white-space:pre">                          </span>.setVerifyModules(false)</div><div><span class="" style="white-space:pre">                           </span>.setMCPU(llvm::sys::getHostCPUName())</div><div><span class="" style="white-space:pre">                              </span>.setOptLevel(useOptimization ? llvm::CodeGenOpt::Default : llvm::CodeGenOpt::None)</div><div><span class="" style="white-space:pre">                         </span>.setTargetOptions(TO)</div><div><span class="" style="white-space:pre">                              </span>.setMCJITMemoryManager(llvm::make_unique<llvm::SectionMemoryManager>())</div><div><span class="" style="white-space:pre">                              </span>.create()</div><div><span class="" style="white-space:pre">                          </span>);</div></div><div><br></div><div>I'm targeting x64 on windows. The last time I profiled it, it spends a lot of time in the SelectionDAG. Which IR constructs would prevent FastIsel from doint its magic ? I might be able to rewrite that IR part.</div><div><br></div><div>The object cache is already in place for the recurring code (80% of code), but there are quite some non-recurring code that needs toe be jitted on the fly.</div><div><br></div><div>I will experiment with ORC also for the memory usage.</div><div><br></div><div>Cheers, </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 13, 2016 at 4:01 AM, Lang Hames <span dir="ltr"><<a href="mailto:lhames@gmail.com" target="_blank">lhames@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 Koffie,<div><br></div><div>I'm surprised to hear that FastISel doesn't help - what architecture are you compiling for? Is it falling back to SelectionDAG often?</div><div><br></div><div>You can use an object cache if you're not already doing so and your use-case allows for it.</div><div><br></div><div>If you switch to ORC you can also use lazy compilation to defer compilation of functions until they're first executed. This can improve startup times, and reduce overall compile times if not all functions are executed.</div><div><br></div><div>Cheers,</div><div>Lang.</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 11, 2016 at 11:47 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"><div><div><div><div>Hi,<br><br></div>What other options do I have to reduce JIT time for large amount of code?<br></div>- setting optimization level to none helps a lot<br></div>- enabling FastISel doesn't seem to  help much<br><br></div>Thanks!<br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>