[Beignet] [PATCH] diasble the SPIR case for llvm before than 3.3.

Zhigang Gong zhigang.gong at linux.intel.com
Thu Mar 12 23:48:56 PDT 2015


> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> xionghu.luo at intel.com
> Sent: Friday, March 13, 2015 2:03 PM
> To: beignet at lists.freedesktop.org
> Cc: xionghu.luo at intel.com
> Subject: [Beignet] [PATCH] diasble the SPIR case for llvm before than 3.3.
> 
> From: Luo Xionghu <xionghu.luo at intel.com>
> 
> the clang 3.5 will call CallGraphSCCPass to add attribute "Attribute::ReadOnly"
> for these parameters only reads memeory, but this attribute is not supported
> in the VerifierPass of llvm 3.3. This is a bug of llvm 3.3.



> 
> Signed-off-by: Luo Xionghu <xionghu.luo at intel.com>
> ---
>  backend/src/llvm/llvm_bitcode_link.cpp | 3 +++
>  utests/CMakeLists.txt                  | 2 +-
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/backend/src/llvm/llvm_bitcode_link.cpp
> b/backend/src/llvm/llvm_bitcode_link.cpp
> index 17248c0..4a8985f 100644
> --- a/backend/src/llvm/llvm_bitcode_link.cpp
> +++ b/backend/src/llvm/llvm_bitcode_link.cpp
> @@ -237,6 +237,9 @@ namespace gbe
>        kernels.push_back(f);
>      }
> 
> +    if(clonedLib->getDataLayout() != mod->getDataLayout())
> +      mod->setDataLayout(clonedLib->getDataLayout());
> +

The above diff should be another patch and need a commit log.

>      /* We use beignet's bitcode as dst because it will have a lot of
>         lazy functions which will not be loaded. */
>      char* errorMsg;
> diff --git a/utests/CMakeLists.txt b/utests/CMakeLists.txt index
> 06baa68..317e27a 100644
> --- a/utests/CMakeLists.txt
> +++ b/utests/CMakeLists.txt
> @@ -192,7 +192,6 @@ set (utests_sources
>    compiler_time_stamp.cpp
>    compiler_double_precision.cpp
>    load_program_from_gen_bin.cpp
> -  load_program_from_spir.cpp
>    get_arg_info.cpp
>    profiling_exec.cpp
>    enqueue_copy_buf.cpp
> @@ -213,6 +212,7 @@ set (utests_sources
>  if (LLVM_VERSION_NODOT VERSION_GREATER 34)
>    SET(utests_sources
>        ${utests_sources}
> +      load_program_from_spir.cpp
A better way is to disable the spir extension for llvm version before 3.5.
Then in the load_program_from_spir case, you could query the extension firstly,
if there is no spir extension, then just do nothing.

Thanks,
Zhigang Gong.

>        compiler_overflow.cpp)
>  endif (LLVM_VERSION_NODOT VERSION_GREATER 34)
> 
> --
> 1.9.1
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet



More information about the Beignet mailing list