<div dir="ltr"><div><div>Thanks a lot for both your answers:<br><br></div>@mats: <br>> Would it not just be a matter of removing<br>
> -Xclang -mlink-bitcode-file -Xclang nvptx--nvidiacl/lib/builtins.opt.bc<br><div id=":1ij" class="">
> from your command? The seems to be the part that links in builtin functions..<br>
</div><br></div><div>I can not do this as in the code I am using some of these builtin functions but not "all" of them. Currently what happens is that all of them get translated to LLVM-IR, even those I don't use. I can manually include only those I am interested in for a specific kernel, but that will not be neat solution.<br><br></div><div>@Dan:<br><span class="im"><br>
</span>> Mark all functions apart from the kernel entry points with the internal attribute and then run global dead code elimination (it should remove most of the unused functions).<br>
> You can use the opt tool to do this.<br>
> e.g. if you had kernel entry points foo and bar you could run the following<br>
> $ opt -internalize-public-api-list= foo,bar -globaldce your_program.bc<br><div id=":1w3" class="">
> transformed_program.bc<br><br></div><div id=":1w3" class="">That would probably help, but I was aiming for a solution that doesn't involve knowing the name of kernel entry points, but I can definitely write a small script that would figure out the kernel entry points for me.<br></div><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 5, 2015 at 6:41 AM, mats petersson <span dir="ltr"><<a href="mailto:mats@planetcatfish.com" target="_blank">mats@planetcatfish.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">So, another "department for ignorance and stupid comments" comment:<br>
<br>
Would it not just be a matter of removing<br>
-Xclang -mlink-bitcode-file -Xclang nvptx--nvidiacl/lib/builtins.opt.bc<br>
from your command? The seems to be the part that links in builtin functions..<br>
<div><div class="h5"><br>
On 5 February 2015 at 13:50, Dan Liew <<a href="mailto:dan@su-root.co.uk">dan@su-root.co.uk</a>> wrote:<br>
> Hi,<br>
><br>
>> which works but it produces LLVM IR code for all OpenCL intrinsics<br>
>> implemented by libclc along with the kernel I am interested in, is their a<br>
>> possibility to avoid this ? and only produce the llvm code for the kernel<br>
>> required ?<br>
><br>
> Mark all functions apart from the kernel entry points with the<br>
> internal attribute and then run global dead code elimination (it<br>
> should remove most of the unused functions).<br>
><br>
> You can use the opt tool to do this.<br>
><br>
> e.g. if you had kernel entry points foo and bar you could run the following<br>
><br>
> $ opt -internalize-public-api-list=foo,bar -globaldce your_program.bc<br>
>> transformed_program.bc<br>
><br>
> Hope that helps.<br>
</div></div>> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br></div>