#9 llvm 10.0.0rc1 release
Merged 4 years ago by tstellar. Opened 4 years ago by sergesanspaille.
rpms/ sergesanspaille/pocl master  into  master

@@ -0,0 +1,123 @@ 

+ From e892494e40b9752303c75231753ee6b6dad5d97f Mon Sep 17 00:00:00 2001

+ From: Michal Babej <michal.babej@tuni.fi>

+ Date: Mon, 16 Sep 2019 11:29:41 +0300

+ Subject: [PATCH 1/3] CMake: Initial LLVM 10.0 support

+ 

+ ---

+  cmake/LLVM.cmake  | 10 +++++++++-

+  config.h.in.cmake |  2 ++

+  include/_kernel.h |  9 +++++++++

+  include/pocl.h    |  4 ++++

+  4 files changed, 24 insertions(+), 1 deletion(-)

+ 

+ diff --git a/cmake/LLVM.cmake b/cmake/LLVM.cmake

+ index ef67685c..a02e2ba7 100644

+ --- a/cmake/LLVM.cmake

+ +++ b/cmake/LLVM.cmake

+ @@ -37,6 +37,7 @@ else()

+    # search for any version

+    find_program(LLVM_CONFIG

+      NAMES

+ +      "llvm-config-mp-10.0" "llvm-config-10" "llvm-config100"

+        "llvm-config-mp-9.0" "llvm-config-9" "llvm-config90"

+        "llvm-config-mp-8.0" "llvm-config-8" "llvm-config80"

+        "llvm-config-mp-7.0" "llvm-config-7" "llvm-config70"

+ @@ -160,20 +161,27 @@ if(LLVM_VERSION MATCHES "^6[.]0")

+    set(LLVM_OLDER_THAN_7_0 1)

+    set(LLVM_OLDER_THAN_8_0 1)

+    set(LLVM_OLDER_THAN_9_0 1)

+ +  set(LLVM_OLDER_THAN_10_0 1)

+  elseif(LLVM_VERSION MATCHES "^7[.]")

+    set(LLVM_MAJOR 7)

+    set(LLVM_7_0 1)

+    set(LLVM_OLDER_THAN_8_0 1)

+    set(LLVM_OLDER_THAN_9_0 1)

+ +  set(LLVM_OLDER_THAN_10_0 1)

+  elseif(LLVM_VERSION MATCHES "^8[.]")

+    set(LLVM_MAJOR 8)

+    set(LLVM_8_0 1)

+    set(LLVM_OLDER_THAN_9_0 1)

+ +  set(LLVM_OLDER_THAN_10_0 1)

+  elseif(LLVM_VERSION MATCHES "^9[.]")

+    set(LLVM_MAJOR 9)

+    set(LLVM_9_0 1)

+ +  set(LLVM_OLDER_THAN_10_0 1)

+ +elseif(LLVM_VERSION MATCHES "^10[.]")

+ +  set(LLVM_MAJOR 10)

+ +  set(LLVM_10_0 1)

+  else()

+ -  message(FATAL_ERROR "LLVM version between 6.0 and 9.0 required, found: ${LLVM_VERSION}")

+ +  message(FATAL_ERROR "LLVM version between 6.0 and 10.0 required, found: ${LLVM_VERSION}")

+  endif()

+  

+  #############################################################

+ diff --git a/config.h.in.cmake b/config.h.in.cmake

+ index 5112fa6c..be7516c2 100644

+ --- a/config.h.in.cmake

+ +++ b/config.h.in.cmake

+ @@ -150,6 +150,8 @@

+  

+  #cmakedefine LLVM_9_0

+  

+ +#cmakedefine LLVM_10_0

+ +

+  #cmakedefine LLVM_BUILD_MODE_DEBUG

+  

+  #ifndef LLVM_VERSION

+ diff --git a/include/_kernel.h b/include/_kernel.h

+ index ba6f2a19..427794e3 100644

+ --- a/include/_kernel.h

+ +++ b/include/_kernel.h

+ @@ -138,12 +138,20 @@

+  # undef LLVM_9_0

+  # define LLVM_9_0

+  

+ +#elif (__clang_major__ == 10)

+ +

+ +# undef LLVM_10_0

+ +# define LLVM_10_0

+ +

+  #else

+  

+  #error Unsupported Clang/LLVM version.

+  

+  #endif

+  

+ +#ifndef LLVM_10_0

+ +#define LLVM_OLDER_THAN_10_0 1

+ +

+  #ifndef LLVM_9_0

+  #define LLVM_OLDER_THAN_9_0 1

+  

+ @@ -160,6 +168,7 @@

+  #endif

+  #endif

+  #endif

+ +#endif

+  

+  /****************************************************************************/

+  

+ diff --git a/include/pocl.h b/include/pocl.h

+ index 9d66844a..1fad38cc 100644

+ --- a/include/pocl.h

+ +++ b/include/pocl.h

+ @@ -369,6 +369,9 @@ struct _cl_command_node

+    cl_int ready;

+  };

+  

+ +#ifndef LLVM_10_0

+ +#define LLVM_OLDER_THAN_10_0 1

+ +

+  #ifndef LLVM_9_0

+  #define LLVM_OLDER_THAN_9_0 1

+  

+ @@ -385,5 +388,6 @@ struct _cl_command_node

+  #endif

+  #endif

+  #endif

+ +#endif

+  

+  #endif /* POCL_H */

+ -- 

+ 2.20.1

+ 

@@ -0,0 +1,316 @@ 

+ From 9899719c0c9d27e18819afaa58c0b3555a40d974 Mon Sep 17 00:00:00 2001

+ From: KOLANICH <kolan_n@mail.ru>

+ Date: Tue, 24 Sep 2019 15:02:09 +0300

+ Subject: [PATCH 2/3] LLVM 10 support Fixes: #772, #773, #774

+ 

+ ---

+  CMakeLists.txt                          | 10 +++++++

+  lib/CL/pocl_llvm_build.cc               | 38 ++++++++++++++++-------

+  lib/CL/pocl_llvm_metadata.cc            |  1 -

+  lib/CL/pocl_llvm_utils.cc               |  1 -

+  lib/CL/pocl_llvm_wg.cc                  |  1 -

+  lib/llvmopencl/CompilerWarnings.h       | 10 +++++++

+  lib/llvmopencl/RemoveBarrierCalls.h     |  4 +++

+  lib/llvmopencl/WorkItemAliasAnalysis.cc | 17 ++++++++---

+  lib/llvmopencl/Workgroup.cc             | 40 ++++++++++++++++++++++---

+  lib/llvmopencl/WorkitemLoops.cc         | 14 +++++++--

+  10 files changed, 112 insertions(+), 24 deletions(-)

+ 

+ diff --git a/CMakeLists.txt b/CMakeLists.txt

+ index 3361df8a..cbbe6825 100644

+ --- a/CMakeLists.txt

+ +++ b/CMakeLists.txt

+ @@ -27,6 +27,16 @@ cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)

+  

+  project(pocl)

+  

+ +set(LATEST_KNOWN_CXX_STD_VERSION "20")

+ +set(SUPPORTED_CXX_STD_VERSION "11")

+ +

+ +option(ENABLE_LATEST_CXX_STD "Upgrade C++ standard version to ${LATEST_KNOWN_CXX_STD_VERSION}. Required to get rid of unused variables warnings in compilers not supporting [[gnu::*]] attributes. Can bring other benefits, including performance and efficiency ones. Before a pull request build with this disabled." OFF)

+ +if(ENABLE_LATEST_CXX_STD)

+ +	set(CMAKE_CXX_STANDARD "${LATEST_KNOWN_CXX_STD_VERSION}")

+ +else()

+ +	set(CMAKE_CXX_STANDARD "${SUPPORTED_CXX_STD_VERSION}")

+ +endif()

+ +

+  # Fix behavior of CMAKE_CXX_STANDARD when targeting macOS.

+  if(POLICY CMP0025)

+    cmake_policy(SET CMP0025 NEW)

+ diff --git a/lib/CL/pocl_llvm_build.cc b/lib/CL/pocl_llvm_build.cc

+ index d65baf0d..881ff02a 100644

+ --- a/lib/CL/pocl_llvm_build.cc

+ +++ b/lib/CL/pocl_llvm_build.cc

+ @@ -40,6 +40,10 @@ IGNORE_COMPILER_WARNING("-Wstrict-aliasing")

+  #include <clang/Frontend/TextDiagnosticPrinter.h>

+  #include "clang/Lex/PreprocessorOptions.h"

+  

+ +#ifdef LLVM_OLDER_THAN_10_0

+ +#include "llvm/ADT/ArrayRef.h"

+ +#endif

+ +

+  #include "llvm/LinkAllPasses.h"

+  #include "llvm/Linker/Linker.h"

+  

+ @@ -48,8 +52,6 @@ IGNORE_COMPILER_WARNING("-Wstrict-aliasing")

+  #include "llvm/IR/Function.h"

+  #include "llvm/IR/Module.h"

+  

+ -#include "llvm/Support/MutexGuard.h"

+ -

+  #ifdef ENABLE_RELOCATION

+  

+  #if defined(__APPLE__)

+ @@ -104,8 +106,14 @@ load_source(FrontendOptions &fe,

+    POCL_RETURN_ERROR_ON(pocl_cache_write_program_source(source_file, program),

+                         CL_OUT_OF_HOST_MEMORY, "Could not write program source");

+  

+ -  fe.Inputs.push_back

+ -      (FrontendInputFile(source_file, clang::InputKind::OpenCL));

+ +  fe.Inputs.push_back(

+ +      FrontendInputFile(source_file,

+ +#ifndef LLVM_OLDER_THAN_10_0

+ +                        clang::InputKind(clang::Language::OpenCL)

+ +#else

+ +                        clang::InputKind::OpenCL

+ +#endif

+ +                            ));

+  

+    return 0;

+  }

+ @@ -382,9 +390,15 @@ int pocl_llvm_build_program(cl_program program,

+    if (program->build_log[device_i])

+      POCL_MEM_FREE(program->build_log[device_i]);

+  

+ -  if (!CompilerInvocation::CreateFromArgs

+ -      (pocl_build, itemcstrs.data(), itemcstrs.data() + itemcstrs.size(),

+ -       diags)) {

+ +  if (!CompilerInvocation::CreateFromArgs(

+ +          pocl_build,

+ +#ifndef LLVM_OLDER_THAN_10_0

+ +          ArrayRef<const char *>(itemcstrs.data(),

+ +                                 itemcstrs.data() + itemcstrs.size()),

+ +#else

+ +          itemcstrs.data(), itemcstrs.data() + itemcstrs.size(),

+ +#endif

+ +          diags)) {

+      pocl_cache_create_program_cachedir(program, device_i, NULL, 0,

+                                         program_bc_path);

+      get_build_log(program, device_i, ss_build_log, diagsBuffer,

+ @@ -395,9 +409,13 @@ int pocl_llvm_build_program(cl_program program,

+    LangOptions *la = pocl_build.getLangOpts();

+    PreprocessorOptions &po = pocl_build.getPreprocessorOpts();

+  

+ -  pocl_build.setLangDefaults

+ -      (*la, clang::InputKind::OpenCL, triple, po,

+ -       clang::LangStandard::lang_opencl12);

+ +  pocl_build.setLangDefaults(*la,

+ +#ifndef LLVM_OLDER_THAN_10_0

+ +                             clang::InputKind(clang::Language::OpenCL),

+ +#else

+ +                             clang::InputKind::OpenCL,

+ +#endif

+ +                             triple, po, clang::LangStandard::lang_opencl12);

+  

+    // LLVM 3.3 and older do not set that char is signed which is

+    // defined by the OpenCL C specs (but not by C specs).

+ diff --git a/lib/CL/pocl_llvm_metadata.cc b/lib/CL/pocl_llvm_metadata.cc

+ index d88a471d..253d93df 100644

+ --- a/lib/CL/pocl_llvm_metadata.cc

+ +++ b/lib/CL/pocl_llvm_metadata.cc

+ @@ -26,7 +26,6 @@

+  IGNORE_COMPILER_WARNING("-Wunused-parameter")

+  

+  #include <llvm/Support/Casting.h>

+ -#include <llvm/Support/MutexGuard.h>

+  #include <llvm/IR/Value.h>

+  #include <llvm/IR/Constants.h>

+  #include <llvm/IR/Type.h>

+ diff --git a/lib/CL/pocl_llvm_utils.cc b/lib/CL/pocl_llvm_utils.cc

+ index 0d99b6d4..1178bfef 100644

+ --- a/lib/CL/pocl_llvm_utils.cc

+ +++ b/lib/CL/pocl_llvm_utils.cc

+ @@ -33,7 +33,6 @@ IGNORE_COMPILER_WARNING("-Wunused-parameter")

+  #include <llvm/ADT/StringRef.h>

+  #include <llvm/ADT/StringMap.h>

+  

+ -#include <llvm/Support/MutexGuard.h>

+  #include <llvm/Support/Host.h>

+  #include <llvm/Support/TargetSelect.h>

+  #include <llvm/Support/SourceMgr.h>

+ diff --git a/lib/CL/pocl_llvm_wg.cc b/lib/CL/pocl_llvm_wg.cc

+ index c31fe668..deacba5b 100644

+ --- a/lib/CL/pocl_llvm_wg.cc

+ +++ b/lib/CL/pocl_llvm_wg.cc

+ @@ -38,7 +38,6 @@

+  IGNORE_COMPILER_WARNING("-Wunused-parameter")

+  

+  #include <llvm/Support/Casting.h>

+ -#include <llvm/Support/MutexGuard.h>

+  #include <llvm/Support/TargetRegistry.h>

+  #include <llvm/Support/SourceMgr.h>

+  #include <llvm/Support/CommandLine.h>

+ diff --git a/lib/llvmopencl/CompilerWarnings.h b/lib/llvmopencl/CompilerWarnings.h

+ index 41c8e8c5..cbb575d4 100644

+ --- a/lib/llvmopencl/CompilerWarnings.h

+ +++ b/lib/llvmopencl/CompilerWarnings.h

+ @@ -59,5 +59,15 @@

+  

+  #endif

+  

+ +#if __cplusplus >= 201703

+ +	#define IGNORE_UNUSED [[maybe_unused]]

+ +#else

+ +	#if defined(__clang__) || defined(__GNUC__)

+ +		#define IGNORE_UNUSED [[gnu::unused]]

+ +	#else

+ +		#define IGNORE_UNUSED 

+ +	#endif

+ +#endif

+ +

+  #endif

+  

+ diff --git a/lib/llvmopencl/RemoveBarrierCalls.h b/lib/llvmopencl/RemoveBarrierCalls.h

+ index ee9315df..5f4f5ede 100644

+ --- a/lib/llvmopencl/RemoveBarrierCalls.h

+ +++ b/lib/llvmopencl/RemoveBarrierCalls.h

+ @@ -28,6 +28,10 @@ IGNORE_COMPILER_WARNING("-Wunused-parameter")

+  

+  #include <llvm/IR/Function.h>

+  

+ +#ifndef LLVM_OLDER_THAN_10_0

+ +#include <llvm/Pass.h>

+ +#endif

+ +

+  POP_COMPILER_DIAGS

+  

+  

+ diff --git a/lib/llvmopencl/WorkItemAliasAnalysis.cc b/lib/llvmopencl/WorkItemAliasAnalysis.cc

+ index 53b6046c..d0d14b60 100644

+ --- a/lib/llvmopencl/WorkItemAliasAnalysis.cc

+ +++ b/lib/llvmopencl/WorkItemAliasAnalysis.cc

+ @@ -116,10 +116,19 @@ WorkItemAAResult WorkItemAA::run(Function &F, AnalysisManager<Function> *AM) {

+      return WorkItemAAResult(AM->getResult<WorkItemAA>(F));

+  }

+  

+ -bool WorkItemAliasAnalysis::runOnFunction(llvm::Function &) {

+ -    auto &TLIWP = getAnalysis<TargetLibraryInfoWrapperPass>();

+ -    Result.reset(new WorkItemAAResult(TLIWP.getTLI()));

+ -    return false;

+ +bool WorkItemAliasAnalysis::runOnFunction(

+ +#ifdef LLVM_OLDER_THAN_10_0

+ +    IGNORE_UNUSED

+ +#endif

+ +    llvm::Function &f) {

+ +  auto &TLIWP = getAnalysis<TargetLibraryInfoWrapperPass>();

+ +#ifndef LLVM_OLDER_THAN_10_0

+ +  auto tli = TLIWP.getTLI(f);

+ +#else

+ +  auto tli = TLIWP.getTLI();

+ +#endif

+ +  Result.reset(new WorkItemAAResult(tli));

+ +  return false;

+  }

+  

+  // Register this pass...

+ diff --git a/lib/llvmopencl/Workgroup.cc b/lib/llvmopencl/Workgroup.cc

+ index afbe224f..bf21e594 100644

+ --- a/lib/llvmopencl/Workgroup.cc

+ +++ b/lib/llvmopencl/Workgroup.cc

+ @@ -992,7 +992,15 @@ Workgroup::createDefaultWorkgroupLauncher(llvm::Function *F) {

+          Arg =

+              new llvm::AllocaInst(ArgElementType, ParamType->getAddressSpace(),

+                                   ConstantInt::get(IntegerType::get(*C, 32), 1),

+ -                                 MAX_EXTENDED_ALIGNMENT, "local_auto", Block);

+ +#ifndef LLVM_OLDER_THAN_10_0

+ +                                 llvm::MaybeAlign(

+ +#endif

+ +                                     MAX_EXTENDED_ALIGNMENT

+ +#ifndef LLVM_OLDER_THAN_10_0

+ +                                     )

+ +#endif

+ +                                     ,

+ +                                 "local_auto", Block);

+        } else {

+          // Dynamic (runtime-set) size local argument.

+  

+ @@ -1006,7 +1014,15 @@ Workgroup::createDefaultWorkgroupLauncher(llvm::Function *F) {

+          Value *ElementCount = Builder.CreateUDiv(

+              LocalArgByteSize, ConstantInt::get(SizeIntType, ElementSize));

+          Arg = new llvm::AllocaInst(ArgElementType, ParamType->getAddressSpace(),

+ -                                   ElementCount, MAX_EXTENDED_ALIGNMENT,

+ +                                   ElementCount,

+ +#ifndef LLVM_OLDER_THAN_10_0

+ +                                   llvm::MaybeAlign(

+ +#endif

+ +                                       MAX_EXTENDED_ALIGNMENT

+ +#ifndef LLVM_OLDER_THAN_10_0

+ +                                       )

+ +#endif

+ +                                       ,

+                                     "local_arg", Block);

+        }

+      } else {

+ @@ -1199,7 +1215,15 @@ Workgroup::createArgBufferWorkgroupLauncher(Function *Func,

+          // Known static local size (converted automatic local).

+          LocalArgAlloca = wrap(new llvm::AllocaInst(

+              unwrap(ArgElementType), LLVMGetPointerAddressSpace(ParamType),

+ -            unwrap(LLVMConstInt(Int32Type, 1, 0)), MAX_EXTENDED_ALIGNMENT,

+ +            unwrap(LLVMConstInt(Int32Type, 1, 0)),

+ +#ifndef LLVM_OLDER_THAN_10_0

+ +            llvm::MaybeAlign(

+ +#endif

+ +                MAX_EXTENDED_ALIGNMENT

+ +#ifndef LLVM_OLDER_THAN_10_0

+ +                )

+ +#endif

+ +                ,

+              "local_auto", unwrap(Block)));

+        } else {

+  

+ @@ -1227,7 +1251,15 @@ Workgroup::createArgBufferWorkgroupLauncher(Function *Func,

+          LocalArgAlloca = wrap(new llvm::AllocaInst(

+              unwrap(LLVMGetElementType(ParamType)),

+              LLVMGetPointerAddressSpace(ParamType), unwrap(ElementCount),

+ -            MAX_EXTENDED_ALIGNMENT, "local_arg", unwrap(Block)));

+ +#ifndef LLVM_OLDER_THAN_10_0

+ +            llvm::MaybeAlign(

+ +#endif

+ +                MAX_EXTENDED_ALIGNMENT

+ +#ifndef LLVM_OLDER_THAN_10_0

+ +                )

+ +#endif

+ +                ,

+ +            "local_arg", unwrap(Block)));

+        }

+        Args[i] = LocalArgAlloca;

+      } else {

+ diff --git a/lib/llvmopencl/WorkitemLoops.cc b/lib/llvmopencl/WorkitemLoops.cc

+ index 18332863..69daa3fa 100644

+ --- a/lib/llvmopencl/WorkitemLoops.cc

+ +++ b/lib/llvmopencl/WorkitemLoops.cc

+ @@ -988,10 +988,18 @@ WorkitemLoops::GetContextArray(llvm::Instruction *instruction,

+       accesses to them. Also, LLVM 3.3 seems to produce illegal

+       code at least with Core i5 when aligned only at the element

+       size. */

+ -  Alloca->setAlignment(CONTEXT_ARRAY_ALIGN);

+ +    Alloca->setAlignment(

+ +#ifndef LLVM_OLDER_THAN_10_0

+ +        llvm::MaybeAlign(

+ +#endif

+ +            CONTEXT_ARRAY_ALIGN

+ +#ifndef LLVM_OLDER_THAN_10_0

+ +            )

+ +#endif

+ +    );

+  

+ -  contextArrays[varName] = Alloca;

+ -  return Alloca;

+ +    contextArrays[varName] = Alloca;

+ +    return Alloca;

+  }

+  

+  /**

+ -- 

+ 2.20.1

+ 

@@ -0,0 +1,96 @@ 

+ From 2e3cb43c158d815aac0fa69a7aba4e7caddefb06 Mon Sep 17 00:00:00 2001

+ From: KOLANICH <kolan_n@mail.ru>

+ Date: Tue, 3 Dec 2019 17:20:04 +0300

+ Subject: [PATCH 3/3] Further llvm 10 compatibility fixes

+  https://github.com/llvm/llvm-project/commit/1dfede3122eec83b885d788553e3620806d54650

+ 

+ ---

+  lib/CL/pocl_llvm_utils.cc |  5 +++++

+  lib/CL/pocl_llvm_wg.cc    | 36 +++++++++++++++++++++++-------------

+  2 files changed, 28 insertions(+), 13 deletions(-)

+ 

+ diff --git a/lib/CL/pocl_llvm_utils.cc b/lib/CL/pocl_llvm_utils.cc

+ index 1178bfef..34cf5ac2 100644

+ --- a/lib/CL/pocl_llvm_utils.cc

+ +++ b/lib/CL/pocl_llvm_utils.cc

+ @@ -56,6 +56,11 @@ IGNORE_COMPILER_WARNING("-Wunused-parameter")

+  #include <llvm/IR/LegacyPassManager.h>

+  #define PassManager legacy::PassManager

+  

+ +#ifndef LLVM_OLDER_THAN_10_0

+ +  #include <llvm/InitializePasses.h>

+ +  #include <llvm/Support/CommandLine.h>

+ +#endif

+ +

+  using namespace llvm;

+  

+  #include <string>

+ diff --git a/lib/CL/pocl_llvm_wg.cc b/lib/CL/pocl_llvm_wg.cc

+ index deacba5b..6b9061e6 100644

+ --- a/lib/CL/pocl_llvm_wg.cc

+ +++ b/lib/CL/pocl_llvm_wg.cc

+ @@ -64,6 +64,17 @@ IGNORE_COMPILER_WARNING("-Wunused-parameter")

+  

+  #include "linker.h"

+  

+ +// Enable to get the LLVM pass execution timing report dumped to console after

+ +// each work-group IR function generation. Requires LLVM > 7.

+ +// #define DUMP_LLVM_PASS_TIMINGS

+ +

+ +#ifndef LLVM_OLDER_THAN_10_0

+ +#include <llvm/IR/PassTimingInfo.h>

+ +#define CODEGEN_FILE_TYPE_NS llvm

+ +#else

+ +#define CODEGEN_FILE_TYPE_NS TargetMachine

+ +#endif

+ +

+  using namespace llvm;

+  

+  /**

+ @@ -580,13 +591,11 @@ int pocl_llvm_codegen(cl_device_id Device, void *Modp, char **Output,

+    llvm::raw_svector_ostream SOS(Data);

+    bool cannotEmitFile;

+  

+ -#ifdef LLVM_OLDER_THAN_7_0

+    cannotEmitFile = Target->addPassesToEmitFile(PMObj, SOS,

+ -                                  TargetMachine::CGFT_ObjectFile);

+ -#else

+ -  cannotEmitFile = Target->addPassesToEmitFile(PMObj, SOS, nullptr,

+ -                                  TargetMachine::CGFT_ObjectFile);

+ +#ifndef LLVM_OLDER_THAN_7_0

+ +                                  nullptr,

+  #endif

+ +                                  CODEGEN_FILE_TYPE_NS::CGFT_ObjectFile);

+  

+    LLVMGeneratesObjectFiles = !cannotEmitFile;

+  

+ @@ -610,17 +619,18 @@ int pocl_llvm_codegen(cl_device_id Device, void *Modp, char **Output,

+    // The LLVM target does not implement support for emitting object file directly.

+    // Have to emit the text first and then call the assembler from the command line

+    // to produce the binary.

+ -#ifdef LLVM_OLDER_THAN_7_0

+ +

+ +

+    if (Target->addPassesToEmitFile(PMAsm, SOS,

+ -                                  TargetMachine::CGFT_AssemblyFile)) {

+ -    POCL_ABORT("The target supports neither obj nor asm emission!");

+ -  }

+ -#else

+ -  if (Target->addPassesToEmitFile(PMAsm, SOS, nullptr,

+ -                                  TargetMachine::CGFT_AssemblyFile)) {

+ +#ifndef LLVM_OLDER_THAN_7_0

+ +                                  nullptr,

+ +#endif

+ +                                  CODEGEN_FILE_TYPE_NS::CGFT_AssemblyFile)) {

+      POCL_ABORT("The target supports neither obj nor asm emission!");

+    }

+ -#endif

+ +

+ +

+ +

+  

+    // This produces the assembly text:

+    PMAsm.run(*Input);

+ -- 

+ 2.20.1

+ 

file modified
+8 -1
@@ -6,7 +6,7 @@ 

  Name:           pocl

  %global ver 1.4

  Version:        %{lua:ver = string.gsub(rpm.expand("%{ver}"), "-", "~"); print(string.lower(ver))}

- Release:        0.3.rc2%{?dist}

+ Release:        0.4.rc2%{?dist}

  

  # The whole code is under MIT

  # except include/utlist.h which is under BSD (and unbundled) and
@@ -19,6 +19,9 @@ 

  Patch0:		0001-Fix-build-failure.patch

  # https://fedoraproject.org/wiki/Changes/Stop-Shipping-Individual-Component-Libraries-In-clang-lib-Package

  Patch1:		0001-Link-against-libclang-cpp.so.patch

+ Patch2:		0001-CMake-Initial-LLVM-10.0-support.patch

+ Patch3:		0002-LLVM-10-support.patch

+ Patch4:		0003-Further-llvm-10-compatibility-fixes.patch

  

  # ppc64le builds fine, but: 97% tests passed, 4 tests failed out of 120

  # ppc64 builds fine, but: 87% tests passed, 16 tests failed out of 120
@@ -92,6 +95,7 @@ 

  %ifarch aarch64 %{arm}

      -DLLC_HOST_CPU="generic" \

  %endif

+     -DENABLE_LATEST_CXX_STD=ON \

      -DPOCL_ICD_ABSOLUTE_PATH=OFF \

      %{nil}

      # -DENABLE_TESTSUITES=all Requires clBLAS
@@ -135,6 +139,9 @@ 

  %{_libdir}/pkgconfig/%{name}.pc

  

  %changelog

+ * Thu Feb 6 2020 sguelton@redhat.com - 1.4-0.4.rc2

+ - Rebuilt for llvm 10.0.0.rc1

+ 

  * Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.4-0.3.rc2

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild