[LLVMdev] Example for usage of LLVM/Clang/libclc

mats petersson mats at planetcatfish.com
Thu Feb 5 06:41:22 PST 2015


So, another "department for ignorance and stupid comments" comment:

Would it not just be a matter of removing
-Xclang -mlink-bitcode-file -Xclang nvptx--nvidiacl/lib/builtins.opt.bc
from your command? The seems to be the part that links in builtin functions..

On 5 February 2015 at 13:50, Dan Liew <dan at su-root.co.uk> wrote:
> Hi,
>
>> which works but it produces LLVM IR code for all OpenCL intrinsics
>> implemented by libclc along with the kernel I am interested in, is their a
>> possibility to avoid this ? and only produce the llvm code for the kernel
>> required ?
>
> 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).
>
> You can use the opt tool to do this.
>
> e.g. if you had kernel entry points foo and bar you could run the following
>
> $ opt -internalize-public-api-list=foo,bar -globaldce your_program.bc
>> transformed_program.bc
>
> Hope that helps.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



More information about the llvm-dev mailing list