gallium: Require LLVM >= 3.7
authorAdam Jackson <ajax@redhat.com>
Fri, 6 Sep 2019 07:50:22 +0000 (09:50 +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>
meson.build
scons/llvm.py
src/gallium/auxiliary/gallivm/lp_bld_init.c
src/gallium/auxiliary/gallivm/lp_bld_misc.cpp

index b856f3acaec057b5a02b161f6ada467c59ee0d47..48be4a122e6f53411c2b1889fcf3a3e31140bf47 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.6.0'
+  _llvm_version = '>= 3.7.0'
 endif
 
 _shared_llvm = get_option('shared-llvm')
index adb93e7f41e06b9f6da1a81609d277d81f3967e4..30a74d85ca5fcd1a9a69ec9680a9c7dba90c8731 100644 (file)
@@ -37,7 +37,7 @@ import SCons.Errors
 import SCons.Util
 
 
-required_llvm_version = '3.6'
+required_llvm_version = '3.7'
 
 
 def generate(env):
@@ -159,24 +159,12 @@ def generate(env):
                 'LLVMSupport',
                 'LLVMIRReader', 'LLVMASMParser'
             ])
-        elif llvm_version >= distutils.version.LooseVersion('3.7'):
-            env.Prepend(LIBS = [
-                'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',
-                'LLVMX86CodeGen', 'LLVMSelectionDAG', 'LLVMAsmPrinter',
-                'LLVMCodeGen', 'LLVMScalarOpts', 'LLVMProfileData',
-                'LLVMInstCombine', 'LLVMInstrumentation', 'LLVMTransformUtils', 'LLVMipa',
-                'LLVMAnalysis', 'LLVMX86Desc', 'LLVMMCDisassembler',
-                'LLVMX86Info', 'LLVMX86AsmPrinter', 'LLVMX86Utils',
-                'LLVMMCJIT', 'LLVMTarget', 'LLVMExecutionEngine',
-                'LLVMRuntimeDyld', 'LLVMObject', 'LLVMMCParser',
-                'LLVMBitReader', 'LLVMMC', 'LLVMCore', 'LLVMSupport'
-            ])
         else:
             env.Prepend(LIBS = [
                 'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',
                 'LLVMX86CodeGen', 'LLVMSelectionDAG', 'LLVMAsmPrinter',
                 'LLVMCodeGen', 'LLVMScalarOpts', 'LLVMProfileData',
-                'LLVMInstCombine', 'LLVMTransformUtils', 'LLVMipa',
+                'LLVMInstCombine', 'LLVMInstrumentation', 'LLVMTransformUtils', 'LLVMipa',
                 'LLVMAnalysis', 'LLVMX86Desc', 'LLVMMCDisassembler',
                 'LLVMX86Info', 'LLVMX86AsmPrinter', 'LLVMX86Utils',
                 'LLVMMCJIT', 'LLVMTarget', 'LLVMExecutionEngine',
index 23d330cff54057cd63c86e1de38591bf2df83430..46355e0277c3229d55fefac2ab3a0a9ec98d7713 100644 (file)
@@ -602,9 +602,7 @@ gallivm_compile_module(struct gallivm_state *gallivm)
 
    /* Disable frame pointer omission on debug/profile builds */
    /* XXX: And workaround http://llvm.org/PR21435 */
-#if (LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7)) && \
-    (defined(DEBUG) || defined(PROFILE) || \
-     defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64))
+#if defined(DEBUG) || defined(PROFILE) || defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
       LLVMAddTargetDependentFunctionAttr(func, "no-frame-pointer-elim", "true");
       LLVMAddTargetDependentFunctionAttr(func, "no-frame-pointer-elim-non-leaf", "true");
 #endif
index 23bf1cf7042d7104c66580235ab69a84b955da95..cf18d6d14f970946c637404b8112c9cd26666ae8 100644 (file)
 #include <llvm/Config/llvm-config.h>
 
 // Workaround http://llvm.org/PR23628
-#if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7)
-#  pragma push_macro("DEBUG")
-#  undef DEBUG
-#endif
+#pragma push_macro("DEBUG")
+#undef DEBUG
 
 #include <llvm/Config/llvm-config.h>
 #include <llvm-c/Core.h>
 #include <llvm/Target/TargetOptions.h>
 #include <llvm/ExecutionEngine/ExecutionEngine.h>
 #include <llvm/ADT/Triple.h>
-#if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7)
 #include <llvm/Analysis/TargetLibraryInfo.h>
-#else
-#include <llvm/Target/TargetLibraryInfo.h>
-#endif
 #include <llvm/ExecutionEngine/SectionMemoryManager.h>
 #include <llvm/Support/CommandLine.h>
 #include <llvm/Support/Host.h>
@@ -80,9 +74,7 @@
 #endif
 
 // Workaround http://llvm.org/PR23628
-#if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7)
-#  pragma pop_macro("DEBUG")
-#endif
+#pragma pop_macro("DEBUG")
 
 #include "c11/threads.h"
 #include "os/os_thread.h"
@@ -160,11 +152,7 @@ LLVMTargetLibraryInfoRef
 gallivm_create_target_library_info(const char *triple)
 {
    return reinterpret_cast<LLVMTargetLibraryInfoRef>(
-#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 7
-   new llvm::TargetLibraryInfo(
-#else
    new llvm::TargetLibraryInfoImpl(
-#endif
    llvm::Triple(triple)));
 }
 
@@ -173,11 +161,7 @@ void
 gallivm_dispose_target_library_info(LLVMTargetLibraryInfoRef library_info)
 {
    delete reinterpret_cast<
-#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 7
-   llvm::TargetLibraryInfo
-#else
    llvm::TargetLibraryInfoImpl
-#endif
    *>(library_info);
 }
 
@@ -333,17 +317,6 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
    options.StackAlignmentOverride = 4;
 #endif
 
-#if defined(DEBUG) && (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 7)
-   options.JITEmitDebugInfo = true;
-#endif
-
-   /* XXX: Workaround http://llvm.org/PR21435 */
-#if defined(DEBUG) || defined(PROFILE) || defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
-#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 7
-   options.NoFramePointerElim = true;
-#endif
-#endif
-
    builder.setEngineKind(EngineKind::JIT)
           .setErrorStr(&Error)
           .setTargetOptions(options)