[Beignet] [PATCH] Make Beignet work with LLVM 3.3

Zhigang Gong zhigang.gong at linux.intel.com
Mon Jun 3 23:51:26 PDT 2013



> -----Original Message-----
> From: beignet-bounces+zhigang.gong=linux.intel.com at lists.freedesktop.org
>
[mailto:beignet-bounces+zhigang.gong=linux.intel.com at lists.freedesktop.org]
> On Behalf Of Dag Lem
> Sent: Monday, June 03, 2013 5:10 PM
> To: beignet at lists.freedesktop.org
> Subject: [Beignet] [PATCH] Make Beignet work with LLVM 3.3
> 
> Hi,
> 
> Fedora 18 users have just been ambushed with LLVM 3.3 RC2, which leaves
> Beignet in an unworkable state.
> 
> This patch makes Beignet work with LLVM 3.3.
> 
> As an added bonus I have switched from the "nvptx" to the "spir" target.
> I was unable to make "nvptx" work with constant globals, since these were
put
> in the global address space. The "nvptx" target also uses a different
address
> space convention than the Khronos SPIR spec, and Beignet has always used
the
> SPIR address space numbers (except for the hack on image types).
[Gong, Zhigang] In general, I agree to migrate to SPIR from NVPTX. Last
time, I noticed
SPIR which is not supported completely in clang/llvm. And there is no
backend using SPIR.
It seems the situation become better now? At least, your patch works fine.
> 
> In any case, I guess SPIR is the way to go. Hopefully someone else will
pick up
> on this and remove the hacks on the built-in types image2d_t, image3d_t,
> sampler_t, and event_t.
[Gong, Zhigang] I will do that when I have some bandwidth. As LLVM3.3
introduces
all of the above keywords, it can simplify some code path.
> 
> Note that I have only tested this on LLVM 3.3; hopefully it should still
work on
> earlier versions of LLVM.
[Gong, Zhigang] I tested it with LLVM3.2 32bit system, and it works great. I
hope someone
who is using LLVM3.1 and 64bit system could also perform test with this
patch.
> 
> Dag Lem (1):
>   Adaptions for LLVM 3.3 / SPIR
> 
>  backend/src/backend/program.cpp             |  17 +-
>  backend/src/ir/unit.cpp                     |   5 +
>  backend/src/ir/unit.hpp                     |   5 +
>  backend/src/llvm/llvm_gen_backend.cpp       |  38 ++-
>  backend/src/llvm/llvm_passes.cpp            |  20 +-
>  backend/src/llvm/llvm_scalarize.cpp         |  17 +-
>  backend/src/llvm/llvm_to_gen.cpp            |  13 +-
>  backend/src/ocl_stdlib.h                    | 359
> ++++++++++++++--------------
>  kernels/compiler_clod.cl                    |   4 +-
>  kernels/compiler_julia.cl                   |   4 +-
>  kernels/compiler_julia_no_break.cl          |   4 +-
>  kernels/compiler_mandelbrot.cl              |   6 +-
>  kernels/compiler_mandelbrot_alternate.cl    |   6 +-
>  kernels/compiler_menger_sponge_no_shadow.cl |  14 +-
>  kernels/compiler_ribbon.cl                  |   2 +-
>  15 files changed, 305 insertions(+), 209 deletions(-)
> 
> --
> 1.8.1.4
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet



More information about the Beignet mailing list