<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 Aug 13, 2015, at 8:22 PM, Eric Christopher <<a href="mailto:echristo@gmail.com" class="">echristo@gmail.com</a>> wrote:</div><div class=""><div dir="ltr" class=""><div class="gmail_quote"><div dir="ltr" class="">On Thu, Aug 13, 2015 at 12:44 PM Andy Somogyi via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><span style="font-family: Courier; font-size: 12px;" class="">Hi</span><div style="font-family: Courier; font-size: 12px;" class=""><br class=""></div><div style="font-family: Courier; font-size: 12px;" class="">I’ve previously used the ExecutionEngine::addGlobalMapping to make existing functions available to my JITed code. </div><div style="font-family: Courier; font-size: 12px;" class=""><br class=""></div><div style="font-family: Courier; font-size: 12px;" class="">I’m currently using ORC, as MCJIT does not appear to be maintained any longer (the kaleidoscope examples have not worked for some time with MCJIT). </div><div style="font-family: Courier; font-size: 12px;" class=""><br class=""></div></div></blockquote><div class=""><br class=""></div><div class="">Which MCJIT tutorials are you building here? The ones linked from the website should work just fine - and all of the jit uses MCJIT underneath the covers in some way or another.</div><div class=""><br class=""></div><div class="">Code link/pointer?</div><div class=""><br class=""></div><div class="">-eric</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div style="font-family: Courier; font-size: 12px;" class=""></div></div></blockquote></div></div></div></blockquote><br class=""></div><div>Hi Eric, </div><div><br class=""></div><div>The standard Kaleidoscope examples do compile, like this one:</div><div><br class=""></div><div><a href="https://github.com/llvm-mirror/llvm/blob/master/examples/Kaleidoscope/Chapter7/toy.cpp" class="">https://github.com/llvm-mirror/llvm/blob/master/examples/Kaleidoscope/Chapter7/toy.cpp</a></div><div><br class=""></div><div>However, only the first JITed function works. The problem is MCJIT does not support adding new functions like the previous standard JIT did. The only way for MCJIT to support adding functions is to create new MCJIT engine instances, and set up the symbol resolver to look in previous instances for existing symbols. </div><div><br class=""></div><div>This kind of code used to be working in </div><div><br class=""></div><div><a href="https://github.com/llvm-mirror/llvm/tree/master/examples/Kaleidoscope/MCJIT" class="">https://github.com/llvm-mirror/llvm/tree/master/examples/Kaleidoscope/MCJIT</a></div><div><br class=""></div><div>However, the last time I checked, a month or so ago, none of the examples in the Kaleidoscope/MCJIT would compile. </div><div><br class=""></div><div>Also, Lang, I'm not sure if the ORC MCJITReplacement supports the ExecutionEngine::addGlobalMapping methods. It looks like the lambda resolver that the MCJITReplacement uses ignores all the values in the global address map when it resolves symbols. </div></body></html>