<div>Hi Hongbin,</div><br><div class="gmail_quote">2012/4/3 Hongbin Zheng <span dir="ltr"><<a href="mailto:etherzhhb@gmail.com">etherzhhb@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Instead of compile the LLVM IR to PTX asm string in a ScopPass, you<br>
can also the improve llc/lli or create new tools to support the code<br>
generation for Heterogeneous platforms[1], i.e. generate code for more<br>
than one target architecture at the same time. Something like this is<br>
not very complicated and had been implemented[2,3] by some people, but<br>
not available in LLVM mainstream. Implement this could make your GPU<br>
project more complete.<br>

<br>
<br>
[1]<a href="http://en.wikipedia.org/wiki/Heterogeneous_computing" target="_blank">http://en.wikipedia.org/wiki/Heterogeneous_computing</a><br>
[2]<a href="http://llvm.org/devmtg/2010-11/Villmow-OpenCL.pdf" target="_blank">http://llvm.org/devmtg/2010-11/Villmow-OpenCL.pdf</a><br>
[3]<a href="http://llvm.org/devmtg/2008-08/Sander_HW-SW-CoDesignflowWithLLVM.pdf" target="_blank">http://llvm.org/devmtg/2008-08/Sander_HW-SW-CoDesignflowWithLLVM.pdf</a></blockquote><div><br></div><div>The original motivation we do this, is to provide a jit compiler for our language frontend (a subset of matlab/octave). I've extended lli to implement a jit compiler (named gvm) to use polly dynamically. However, preliminary results show that the overhead is heavy. I choose to offload the dynamic optimization from the jitting process.  And also putting the LLVM to PTX asm string pass into polly can provide a kind of one-touch experience to users. </div>
<div><br></div><div>Please imagine such a user scenario<span style="color:rgb(34,34,34);font-family:arial,sans-serif;line-height:16px;background-color:rgb(255,255,255)">.</span>  When a user open a matlab source file or a folder contained source files, we can start to compile the source statically and use polly and opt to optimize it to get the optimal version llvm ir. Finally, when the user click run or the enter key, we just need jit the llvm ir as normal one, minimizing the dynamic overhead.</div>
<div><br></div><div>Thanks for the recommendation of the references</div><div><br></div><div>best regards,</div><div>Yabin. </div></div>