[cfe-dev] Clang command for OpenCL

Anastasia Stulova via cfe-dev cfe-dev at lists.llvm.org
Thu May 21 06:14:19 PDT 2020


Hi Enrique,

The command line below should emit a bitcode file:

clang -cc1 -cl-std=CL2.0 -finclude-default-header -emit-llvm-bc -triple spir64 -cl-single-precision-constant INPUT.cl -o INPUT.bc

Let me know if you have any other issues.
Cheers,
Anastasia

________________________________
From: cfe-dev <cfe-dev-bounces at lists.llvm.org> on behalf of Enrique González via cfe-dev <cfe-dev at lists.llvm.org>
Sent: 20 May 2020 11:59
To: cfe-dev at lists.llvm.org <cfe-dev at lists.llvm.org>
Subject: [cfe-dev] Clang command for OpenCL

Dear all,

I am trying to use a command like the following one to convert an OpenCL file into a bytecode:

clang -x cl -cl-std=CL2.0 -emit-llvm -target spir64 -Xclang -finclude-default-header -cl-single-precision-constant INPUT.cl -o INPUT.bc

This command gives me a .llc file as output instead of a .bc. Which is the error? I cannot use the flag "-emit-llvm-bc" without using the frontend.

I attach the compilation link:
https://godbolt.org/z/QRgojA
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200521/0a66c6fc/attachment.html>


More information about the cfe-dev mailing list