gallium: Require LLVM >= 3.5
authorAdam Jackson <ajax@redhat.com>
Fri, 6 Sep 2019 07:29:32 +0000 (09:29 +0200)
committerAdam Jackson <ajax@nwnk.net>
Wed, 11 Sep 2019 17:00:43 +0000 (17:00 +0000)
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
[ Michel Dänzer: Dropped jessie line from debian-install.sh again ]

.gitlab-ci.yml
.gitlab-ci/debian-install.sh
meson.build
scons/llvm.py
src/gallium/auxiliary/gallivm/lp_bld_init.c
src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
src/gallium/auxiliary/gallivm/lp_bld_misc.h

index 6a5dde86ed357376a69e5306afd10a0aa275177d..7d8e988c3330ac56a2fbfb6258ff8bafa1703613 100644 (file)
@@ -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
index 7e5b14232e70023c00435a6ce042c58f2515e5fe..8f843b96a8fb96b6d361f6a4313b02aaa7590bdc 100644 (file)
@@ -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 \
index 483404404f71ff953cf1789196332375a8cb658e..f6017de7b99db39184c30902578f475c61648f06 100644 (file)
@@ -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')
index 2f65365060f0aa197e91e6ee77a4b66a028760da..49e513ade18eb89b829f97158d3ef684c25b196d 100644 (file)
@@ -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
index d534f0236b69e693ecce905176fc3f468fe86b96..52e1ace9e0d8ff25a8f4c2f2ebbac7cf4078560f 100644 (file)
@@ -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)>]");
    }
 
index f0f7edefffae6ff6b9a135e0bb54a06932eec83b..b3ec969ce3e9284e0d4c5cfc7d0ba085a464fbbc 100644 (file)
@@ -75,9 +75,7 @@
 
 #include <llvm/Support/TargetSelect.h>
 
-#if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5)
 #include <llvm/IR/CallSite.h>
-#endif
 #include <llvm/IR/IRBuilder.h>
 #include <llvm/IR/Module.h>
 #include <llvm/Support/CBindingWrapping.h>
@@ -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<llvm::Instruction>(call)).getCalledValue());
 #else
-       return NULL; /* radeonsi doesn't support so old LLVM. */
+       return llvm::wrap(llvm::CallSite(llvm::unwrap<llvm::Instruction>(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
index e52eb7de8a794e40f63115cfe3212260828f8812..5a19ba1bd2d565e0a7165d910f7f915f972fa5c6 100644 (file)
@@ -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