Clang command for OpenCL

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Clang command for OpenCL

Fangrui Song via cfe-dev
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:

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Clang command for OpenCL

Fangrui Song via cfe-dev
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 <[hidden email]> on behalf of Enrique González via cfe-dev <[hidden email]>
Sent: 20 May 2020 11:59
To: [hidden email] <[hidden email]>
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:

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev