From 3c553d9cff0b541bb1f0c83b92458a312f40bb25 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Fri, 6 Sep 2019 09:29:32 +0200 Subject: [PATCH] gallium: Require LLVM >= 3.5 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Timothy Arceri Reviewed-by: Jose Fonseca [ Michel Dänzer: Dropped jessie line from debian-install.sh again ] --- .gitlab-ci.yml | 6 ++--- .gitlab-ci/debian-install.sh | 2 -- meson.build | 2 +- scons/llvm.py | 21 ++++------------- src/gallium/auxiliary/gallivm/lp_bld_init.c | 2 +- src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 23 +------------------ src/gallium/auxiliary/gallivm/lp_bld_misc.h | 5 ---- 7 files changed, 9 insertions(+), 52 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6a5dde86ed3..7d8e988c333 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,7 +14,7 @@ # repository's registry will be used there as well. variables: UPSTREAM_REPO: mesa/mesa - DEBIAN_TAG: "2019-08-09" + DEBIAN_TAG: "2019-09-11" DEBIAN_VERSION: stretch-slim DEBIAN_IMAGE: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_TAG" @@ -321,9 +321,7 @@ scons-llvm: variables: SCONS_TARGET: "llvm=1" SCONS_CHECK_COMMAND: "scons llvm=1 check" - LLVM_VERSION: "3.4" - # LLVM 3.4 packages were built with an old libstdc++ ABI - CXX: "g++ -D_GLIBCXX_USE_CXX11_ABI=0" + LLVM_VERSION: "3.9" .deqp-test: <<: *ci-run-policy diff --git a/.gitlab-ci/debian-install.sh b/.gitlab-ci/debian-install.sh index 7e5b14232e7..8f843b96a8f 100644 --- a/.gitlab-ci/debian-install.sh +++ b/.gitlab-ci/debian-install.sh @@ -24,11 +24,9 @@ echo "deb [trusted=yes] https://apt.llvm.org/stretch/ llvm-toolchain-stretch-8 m sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list echo 'deb https://deb.debian.org/debian stretch-backports main' >/etc/apt/sources.list.d/backports.list -echo 'deb https://deb.debian.org/debian jessie main' >/etc/apt/sources.list.d/jessie.list apt-get update apt-get install -y -t stretch-backports \ - llvm-3.4-dev \ llvm-3.9-dev \ libclang-3.9-dev \ llvm-4.0-dev \ diff --git a/meson.build b/meson.build index 483404404f7..f6017de7b99 100644 --- a/meson.build +++ b/meson.build @@ -1264,7 +1264,7 @@ elif with_gallium_swr elif with_gallium_opencl or with_gallium_r600 _llvm_version = '>= 3.9.0' else - _llvm_version = '>= 3.4.0' + _llvm_version = '>= 3.5.0' endif _shared_llvm = get_option('shared-llvm') diff --git a/scons/llvm.py b/scons/llvm.py index 2f65365060f..49e513ade18 100644 --- a/scons/llvm.py +++ b/scons/llvm.py @@ -37,7 +37,7 @@ import SCons.Errors import SCons.Util -required_llvm_version = '3.4' +required_llvm_version = '3.5' def generate(env): @@ -183,7 +183,7 @@ def generate(env): 'LLVMRuntimeDyld', 'LLVMObject', 'LLVMMCParser', 'LLVMBitReader', 'LLVMMC', 'LLVMCore', 'LLVMSupport' ]) - elif llvm_version >= distutils.version.LooseVersion('3.5'): + else: env.Prepend(LIBS = [ 'LLVMMCDisassembler', 'LLVMBitWriter', 'LLVMMCJIT', 'LLVMRuntimeDyld', @@ -196,18 +196,6 @@ def generate(env): 'LLVMAnalysis', 'LLVMTarget', 'LLVMMC', 'LLVMCore', 'LLVMSupport' ]) - else: - env.Prepend(LIBS = [ - 'LLVMMCDisassembler', - 'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser', - 'LLVMX86CodeGen', 'LLVMX86Desc', 'LLVMSelectionDAG', - 'LLVMAsmPrinter', 'LLVMMCParser', 'LLVMX86AsmPrinter', - 'LLVMX86Utils', 'LLVMX86Info', 'LLVMMCJIT', 'LLVMJIT', - 'LLVMExecutionEngine', 'LLVMCodeGen', 'LLVMScalarOpts', - 'LLVMInstCombine', 'LLVMTransformUtils', 'LLVMipa', - 'LLVMAnalysis', 'LLVMTarget', 'LLVMMC', 'LLVMCore', - 'LLVMSupport', 'LLVMRuntimeDyld', 'LLVMObject' - ]) env.Append(LIBS = [ 'imagehlp', 'psapi', @@ -270,9 +258,8 @@ def generate(env): env.ParseConfig('%s --libs ' % llvm_config + ' '.join(components)) env.ParseConfig('%s --ldflags' % llvm_config) - if llvm_version >= distutils.version.LooseVersion('3.5'): - env.ParseConfig('%s --system-libs' % llvm_config) - env.Append(CXXFLAGS = ['-std=c++14']) + env.ParseConfig('%s --system-libs' % llvm_config) + env.Append(CXXFLAGS = ['-std=c++14']) except OSError: print('scons: llvm-config version %s failed' % llvm_version) return diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c index d534f0236b6..52e1ace9e0d 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_init.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c @@ -626,7 +626,7 @@ gallivm_compile_module(struct gallivm_state *gallivm) "-sroa -early-cse -simplifycfg -reassociate " "-mem2reg -constprop -instcombine -gvn", filename, gallivm_debug & GALLIVM_PERF_NO_OPT ? 0 : 2, - (LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5)) ? "[-mcpu=<-mcpu option>] " : "", + "[-mcpu=<-mcpu option>] ", "[-mattr=<-mattr option(s)>]"); } diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp index f0f7edefffa..b3ec969ce3e 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp @@ -75,9 +75,7 @@ #include -#if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5) #include -#endif #include #include #include @@ -514,12 +512,10 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT, MAttrs.push_back("-avx512er"); MAttrs.push_back("-avx512f"); MAttrs.push_back("-avx512pf"); -#if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5) MAttrs.push_back("-avx512bw"); MAttrs.push_back("-avx512dq"); MAttrs.push_back("-avx512vl"); #endif -#endif #if defined(PIPE_ARCH_ARM) if (!util_cpu_caps.has_neon) { MAttrs.push_back("-neon"); @@ -557,7 +553,6 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT, } } -#if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5) StringRef MCPU = llvm::sys::getHostCPUName(); /* * The cpu bits are no longer set automatically, so need to set mcpu manually. @@ -588,7 +583,6 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT, if (gallivm_debug & (GALLIVM_DEBUG_IR | GALLIVM_DEBUG_ASM | GALLIVM_DEBUG_DUMP_BC)) { debug_printf("llc -mcpu option: %s\n", MCPU.str().c_str()); } -#endif ShaderMemoryManager *MM = NULL; if (useMCJIT) { @@ -665,10 +659,8 @@ lp_get_called_value(LLVMValueRef call) { #if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 9) return LLVMGetCalledValue(call); -#elif LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5) - return llvm::wrap(llvm::CallSite(llvm::unwrap(call)).getCalledValue()); #else - return NULL; /* radeonsi doesn't support so old LLVM. */ + return llvm::wrap(llvm::CallSite(llvm::unwrap(call)).getCalledValue()); #endif } @@ -707,20 +699,7 @@ LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Ptr, { return llvm::wrap(llvm::unwrap(B)->CreateAtomicCmpXchg(llvm::unwrap(Ptr), llvm::unwrap(Cmp), llvm::unwrap(New), mapFromLLVMOrdering(SuccessOrdering), -#if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5) mapFromLLVMOrdering(FailureOrdering), -#endif SingleThread ? llvm::SynchronizationScope::SingleThread : llvm::SynchronizationScope::CrossThread)); } #endif - -#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 5 -LLVMValueRef LLVMBuildFence(LLVMBuilderRef B, - LLVMAtomicOrdering ordering, - LLVMBool singleThread, - const char *Name) -{ - return llvm::wrap(llvm::unwrap(B)->CreateFence(mapFromLLVMOrdering(ordering), - singleThread ? llvm::SynchronizationScope::SingleThread : llvm::SynchronizationScope::CrossThread)); -} -#endif diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.h b/src/gallium/auxiliary/gallivm/lp_bld_misc.h index e52eb7de8a7..5a19ba1bd2d 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_misc.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.h @@ -86,11 +86,6 @@ LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMBool SingleThread); #endif -#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 5 -LLVMValueRef LLVMBuildFence(LLVMBuilderRef B, - LLVMAtomicOrdering ordering, - LLVMBool singleThread, const char *Name); -#endif #ifdef __cplusplus } #endif -- 2.30.2