[LLVMdev] [cfe-dev] OpenCL SPIR/NVPTX code generation
jordan_rose at apple.com
Wed Jan 23 09:47:29 PST 2013
On Jan 23, 2013, at 4:04 , "Benyei, Guy" <guy.benyei at intel.com> wrote:
> Hi Ankur,
> Since you use –Xclang, the clang executable passes multiple triples to “clang -cc1”. You can see that if you add the -v option. I’m sure there is someone here who can explain it better than I…
> Anyhow, I think you better use clang -cc1. Make sure -cc1 is the first command line option you use.
> $ clang -cc1 -fno-builtin -emit-llvm-bc -triple spir-unknown-unknown Simple_Kernel.cl -o Simple_Kernel.bc
> should work for you.
clang -cc1 shouldn't ever be necessary for end users of clang, particularly because cc1 options are not guaranteed to be stable. You also lose all the default options that the driver normally passes down. It's possible this doesn't matter much for SPIR, at least not right now, but it's not something we should be recommending or supporting.
-target is the driver version of -triple. This "worked" for me, where by "worked" I mean "generated some output but I don't know enough about SPIR to validate it".
% clang -x cl -fno-builtin -target spir -c -emit-llvm
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev