[cfe-dev] Backend for C and OpenCL

Alberto Magni alberto.magni86 at gmail.com
Wed Oct 5 10:53:30 PDT 2011


Hi everybody,

for a research project I would like to use LLVM to optimize
OpenCL programs for GPUs.

Due to the lack of open-source back-ends and runtimes for
GPUs my idea is the following:
1) compile OpenCL C into LLVM-IR (for what I read on the ML
full support is close, at least foreseeable),
2) apply LLVM transformations to the bitcode,
3) generate the OpenCL C code from the optimized bitcode,
4) use the official (Nvidia, AMD, Intel, ....) OpenCL compilers
and runtimes for the actual execution of the optimized code

I know that the C backend is buggy and it is no more
supported but it still works with simple C programs.
Remeber that OpenCL programs are usually quite simple
(no function pointers, etc...)

The main features to be added to the backend are:
1) the "__kernel" keyword,
2) the four address spaces keywords
3) vector data types
4) the half keyword

My idea is to extensively verify the functionality the C-backend for
C programs (similar to OpenCL-C ones) and possibly add the listed features.

What do you think of this ? Is it feasible ?

Thank you,

Alberto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20111005/4b2d4d75/attachment.html>


More information about the cfe-dev mailing list