diff --git a/meson.build b/meson.build index e0c4f18afe4..492142f0570 100644 --- a/meson.build +++ b/meson.build @@ -1723,12 +1723,10 @@ if with_tests or with_gallium_softpipe llvm_modules += 'native' endif -if with_amd_vk or with_gallium_radeonsi +if with_amd_vk or with_gallium_radeonsi or with_gallium_opencl _llvm_version = '>= 11.0.0' elif with_clc _llvm_version = '>= 10.0.0' -elif with_gallium_opencl - _llvm_version = '>= 8.0.0' else _llvm_version = '>= 3.9.0' endif diff --git a/src/gallium/frontends/clover/llvm/codegen/bitcode.cpp b/src/gallium/frontends/clover/llvm/codegen/bitcode.cpp index 102df000148..568bdd993f5 100644 --- a/src/gallium/frontends/clover/llvm/codegen/bitcode.cpp +++ b/src/gallium/frontends/clover/llvm/codegen/bitcode.cpp @@ -41,12 +41,8 @@ #include #include -#if LLVM_VERSION_MAJOR < 4 -#include -#else #include #include -#endif #include using clover::binary; diff --git a/src/gallium/frontends/clover/llvm/compat.hpp b/src/gallium/frontends/clover/llvm/compat.hpp index 1127a397fde..83e2fcd8d2f 100644 --- a/src/gallium/frontends/clover/llvm/compat.hpp +++ b/src/gallium/frontends/clover/llvm/compat.hpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -52,10 +53,6 @@ #include #include -#if LLVM_VERSION_MAJOR >= 10 -#include -#endif - #if LLVM_VERSION_MAJOR >= 14 #include #else @@ -66,35 +63,19 @@ namespace clover { namespace llvm { namespace compat { -#if LLVM_VERSION_MAJOR >= 10 const auto CGFT_ObjectFile = ::llvm::CGFT_ObjectFile; const auto CGFT_AssemblyFile = ::llvm::CGFT_AssemblyFile; typedef ::llvm::CodeGenFileType CodeGenFileType; -#else - const auto CGFT_ObjectFile = ::llvm::TargetMachine::CGFT_ObjectFile; - const auto CGFT_AssemblyFile = - ::llvm::TargetMachine::CGFT_AssemblyFile; - typedef ::llvm::TargetMachine::CodeGenFileType CodeGenFileType; -#endif -#if LLVM_VERSION_MAJOR >= 10 const clang::InputKind ik_opencl = clang::Language::OpenCL; -#else - const clang::InputKind ik_opencl = clang::InputKind::OpenCL; -#endif template inline bool create_compiler_invocation_from_args(clang::CompilerInvocation &cinv, T copts, clang::DiagnosticsEngine &diag) { -#if LLVM_VERSION_MAJOR >= 10 return clang::CompilerInvocation::CreateFromArgs( cinv, copts, diag); -#else - return clang::CompilerInvocation::CreateFromArgs( - cinv, copts.data(), copts.data() + copts.size(), diag); -#endif } static inline void @@ -118,31 +99,19 @@ namespace clover { static inline bool is_scalable_vector(const ::llvm::Type *type) { -#if LLVM_VERSION_MAJOR >= 11 return ::llvm::isa<::llvm::ScalableVectorType>(type); -#else - return false; -#endif } static inline bool is_fixed_vector(const ::llvm::Type *type) { -#if LLVM_VERSION_MAJOR >= 11 return ::llvm::isa<::llvm::FixedVectorType>(type); -#else - return type->isVectorTy(); -#endif } static inline unsigned get_fixed_vector_elements(const ::llvm::Type *type) { -#if LLVM_VERSION_MAJOR >= 11 return ::llvm::cast<::llvm::FixedVectorType>(type)->getNumElements(); -#else - return ((::llvm::VectorType*)type)->getNumElements(); -#endif } } }