Hello community, here is the log from the commit of package beignet for openSUSE:Factory checked in at 2019-01-08 12:28:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/beignet (Old) and /work/SRC/openSUSE:Factory/.beignet.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "beignet" Tue Jan 8 12:28:54 2019 rev:16 rq:663277 version:1.3.2 Changes: -------- --- /work/SRC/openSUSE:Factory/beignet/beignet.changes 2018-11-09 07:54:21.139715749 +0100 +++ /work/SRC/openSUSE:Factory/.beignet.new.28833/beignet.changes 2019-01-08 12:31:16.120089741 +0100 @@ -1,0 +2,8 @@ +Mon Jan 7 04:23:07 UTC 2019 - Linnaea Lavia <[email protected]> + +- Fix build failure with llvm7 with patch from upstream Git: + * 0008-Add-preliminary-LLVM-7-support.patch +- Fix self-test failures on some systems: + * beignet-disable-NegAddOptimization.patch + +------------------------------------------------------------------- New: ---- 0008-Add-preliminary-LLVM-7-support.patch beignet-disable-NegAddOptimization.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ beignet.spec ++++++ --- /var/tmp/diff_new_pack.thZTFm/_old 2019-01-08 12:31:16.708089101 +0100 +++ /var/tmp/diff_new_pack.thZTFm/_new 2019-01-08 12:31:16.708089101 +0100 @@ -1,7 +1,7 @@ # # spec file for package beignet # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # @@ -26,6 +26,8 @@ Source0: https://01.org/sites/default/files/%{name}-%{version}-source.tar.gz Source99: beignet-rpmlintrc Patch0: beignet-llvm6.patch +Patch1: 0008-Add-preliminary-LLVM-7-support.patch +Patch2: beignet-disable-NegAddOptimization.patch BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: ncurses-devel @@ -66,6 +68,8 @@ %prep %setup -q -n Beignet-%{version}-Source %patch0 -p1 +%patch1 -p1 +%patch2 -p1 rm README.md cp docs/Beignet.mdwn README.md ++++++ 0008-Add-preliminary-LLVM-7-support.patch ++++++ >From e1b2419a0008e38ef2d9d255d9e9c74e9fba084b Mon Sep 17 00:00:00 2001 From: "Rebecca N. Palmer" <[email protected]> Date: Sat, 21 Jul 2018 20:05:54 +0100 Subject: [PATCH 08/10] Add preliminary LLVM 7 support This is preliminary because LLVM 7 has not been released yet: it was tested with the snapshot from Debian experimental (svn336894). 1.Change linking order, as clangCodeGen now links to clangFrontend 2.Pass references not pointers to WriteBitcodeToFile and CloneModule 3.Add the headers that LoopSimplifyID, LCSSAID and some create*Pass have moved to 4.Define our DEBUG whether or not we just undefined LLVM's (theirs is now LLVM_DEBUG, but we never actually use it) Signed-off-by: Rebecca N. Palmer <[email protected]> Reviewed-by: Yang Rong <[email protected]> --- CMake/FindLLVM.cmake | 2 +- backend/src/backend/gen_program.cpp | 8 ++++++++ backend/src/backend/program.cpp | 4 ++++ backend/src/llvm/ExpandLargeIntegers.cpp | 2 +- backend/src/llvm/llvm_bitcode_link.cpp | 4 ++++ backend/src/llvm/llvm_includes.hpp | 4 ++++ 6 files changed, 22 insertions(+), 2 deletions(-) diff --git a/CMake/FindLLVM.cmake b/CMake/FindLLVM.cmake index 5457f248..f882589d 100644 --- a/CMake/FindLLVM.cmake +++ b/CMake/FindLLVM.cmake @@ -113,10 +113,10 @@ macro(add_one_lib name) endmacro() #Assume clang lib path same as llvm lib path +add_one_lib("clangCodeGen") add_one_lib("clangFrontend") add_one_lib("clangSerialization") add_one_lib("clangDriver") -add_one_lib("clangCodeGen") add_one_lib("clangSema") add_one_lib("clangStaticAnalyzerFrontend") add_one_lib("clangStaticAnalyzerCheckers") diff --git a/backend/src/backend/gen_program.cpp b/backend/src/backend/gen_program.cpp index 274c99c7..41592349 100644 --- a/backend/src/backend/gen_program.cpp +++ b/backend/src/backend/gen_program.cpp @@ -454,7 +454,11 @@ namespace gbe { #ifdef GBE_COMPILER_AVAILABLE std::string str; llvm::raw_string_ostream OS(str); +#if LLVM_VERSION_MAJOR >= 7 + llvm::WriteBitcodeToFile(*((llvm::Module*)prog->module), OS); +#else llvm::WriteBitcodeToFile((llvm::Module*)prog->module, OS); +#endif std::string& bin_str = OS.str(); int llsz = bin_str.size(); *binary = (char *)malloc(sizeof(char) * (llsz+1) ); @@ -545,7 +549,11 @@ namespace gbe { &modRef); src = llvm::unwrap(modRef); } +#if LLVM_VERSION_MAJOR >= 7 + llvm::Module* clone = llvm::CloneModule(*src).release(); +#else llvm::Module* clone = llvm::CloneModule(src).release(); +#endif if (LLVMLinkModules2(wrap(dst), wrap(clone))) { #elif LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 37 if (LLVMLinkModules(wrap(dst), wrap(src), LLVMLinkerPreserveSource_Removed, &errMsg)) { diff --git a/backend/src/backend/program.cpp b/backend/src/backend/program.cpp index c37c5951..b36f7b4a 100644 --- a/backend/src/backend/program.cpp +++ b/backend/src/backend/program.cpp @@ -794,7 +794,11 @@ namespace gbe { llvm::raw_fd_ostream ostream (dumpSPIRBinaryName.c_str(), err, llvm::sys::fs::F_None); if (!err) +#if LLVM_VERSION_MAJOR<7 llvm::WriteBitcodeToFile(*out_module, ostream); +#else + llvm::WriteBitcodeToFile(**out_module, ostream); +#endif } #endif return true; diff --git a/backend/src/llvm/ExpandLargeIntegers.cpp b/backend/src/llvm/ExpandLargeIntegers.cpp index 8515dc13..4aec44ee 100644 --- a/backend/src/llvm/ExpandLargeIntegers.cpp +++ b/backend/src/llvm/ExpandLargeIntegers.cpp @@ -99,8 +99,8 @@ using namespace llvm; #ifdef DEBUG #undef DEBUG - #define DEBUG(...) #endif +#define DEBUG(...) // Break instructions up into no larger than 64-bit chunks. static const unsigned kChunkBits = 64; static const unsigned kChunkBytes = kChunkBits / CHAR_BIT; diff --git a/backend/src/llvm/llvm_bitcode_link.cpp b/backend/src/llvm/llvm_bitcode_link.cpp index ef56e4c2..4c3e20e4 100644 --- a/backend/src/llvm/llvm_bitcode_link.cpp +++ b/backend/src/llvm/llvm_bitcode_link.cpp @@ -340,7 +340,11 @@ namespace gbe /* We use beignet's bitcode as dst because it will have a lot of lazy functions which will not be loaded. */ #if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 39 +#if LLVM_VERSION_MAJOR >= 7 + llvm::Module * linked_module = llvm::CloneModule(*(llvm::Module*)mod).release(); +#else llvm::Module * linked_module = llvm::CloneModule((llvm::Module*)mod).release(); +#endif if(LLVMLinkModules2(wrap(clonedLib), wrap(linked_module))) { #else char* errorMsg; diff --git a/backend/src/llvm/llvm_includes.hpp b/backend/src/llvm/llvm_includes.hpp index 184553af..ffccf025 100644 --- a/backend/src/llvm/llvm_includes.hpp +++ b/backend/src/llvm/llvm_includes.hpp @@ -89,6 +89,10 @@ #include "llvm/CodeGen/IntrinsicLowering.h" #include "llvm/Transforms/Scalar.h" +#if LLVM_VERSION_MAJOR >= 7 +#include "llvm/Transforms/Utils.h" +#include "llvm/Transforms/InstCombine/InstCombine.h" +#endif #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCInstrInfo.h" -- 2.20.1.windows.1 ++++++ beignet-disable-NegAddOptimization.patch ++++++ Disable optimization for negative modifier introduced in 1.3.2 in upstream commit 81755054c4c19d821e58456a1a7d601806e60e92 (cherry-picked from f8053378a254e0eac9b5b2188e81a0308e290647) as it's causing self-test failures, seen in upstream GitHub issue #7(https://github.com/intel/beignet/issues/7) with the following message: Beignet: self-test failed: (3, 7, 5) + (5, 7, 3) returned (6, 7, 5) Index: Beignet-1.3.2-Source/backend/src/backend/gen_insn_selection_optimize.cpp =================================================================== --- Beignet-1.3.2-Source.orig/backend/src/backend/gen_insn_selection_optimize.cpp +++ Beignet-1.3.2-Source/backend/src/backend/gen_insn_selection_optimize.cpp @@ -303,6 +303,7 @@ namespace gbe Do it just like a: mov b, -b, so it is a Mov operation like LocalCopyPropagation */ void SelBasicBlockOptimizer::doNegAddOptimization(SelectionInstruction &insn) { +#if 0 if (insn.opcode == SEL_OP_ADD) { GenRegister src0 = insn.src(0); GenRegister src1 = insn.src(1); @@ -310,6 +311,7 @@ namespace gbe (src1.negation && src0.file == GEN_IMMEDIATE_VALUE && src0.value.f == 0.0f)) addToReplaceInfoMap(insn); } +#endif } void SelBasicBlockOptimizer::run()
