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

xionghu.luo at intel.com xionghu.luo at intel.com
Thu Mar 12 23:03:26 PDT 2015


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());
+
     /* 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
       compiler_overflow.cpp)
 endif (LLVM_VERSION_NODOT VERSION_GREATER 34)
 
-- 
1.9.1



More information about the Beignet mailing list