[LLVMdev] Upstream PTX backend that uses target independent code generator if possible

David A. Greene greened at obbligato.org
Mon Aug 9 15:25:32 PDT 2010

Che-Liang Chiou <clchiou at gmail.com> writes:

> Hi there,
> I have a working prototype of PTX backend, and I would like to
> upstream it if possible.  This backend is implemented by LLVM's target
> independent code generator framework; I think this will make it easier
> to maintain.

How does this relate, at all, to the backend here:


If they are unrelated, can you do a comparison of the two?  Perhaps
there are holes in each that can be filled by the other.  It would be
a shame to have two completely different PTX backends.

> I have tested this backend to translate a work-efficient parallel scan
> kernel ( http://http.developer.nvidia.com/GPUGems3/gpugems3_ch39.html
> ) into PTX code.  The generated PTX code was then executed on real
> hardware, and the result is correct.

How much of the LLVM IR does this support?  What's missing?

> So far I have to hack clang to generate bitcode for this backend, but
> I will try to patch clang to parse CUDA (or OpenCL) while I am
> upstreaming this backend.

I think it's a lot of work to do CUDA support for not much benefit.
The OpenMP committee is working on accelerator directives and that's
the better long-term approach, IMHO.  Clang/LLVM would be a great
vehicle to generate/test ideas for such directives.



More information about the llvm-dev mailing list