From 559c027adeaa33d19c8cfee828cc7220239fea70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20Wasserb=C3=A4ch?= Date: Tue, 19 Apr 2022 20:41:29 +0200 Subject: [PATCH] chore(deps): clover: raise the minimum LLVM version to 11.0.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LLVM 11 was released in October 2020. If you want to build against Mesa's Git version, that seems like enough time to upgrade to at least LLVM 11 (Debian stable has this too). It reduces the amount of #if gates we need and more will be incoming again, given the Opaque Pointer transition. Additionally radeonsi is already requiring LLVM 11. Therefore the minimum will have been LLVM 11 for many builds anyway. Note that clc is kept to LLVM 10 for the time being. Signed-off-by: Kai Wasserbäch Reviewed-by: Karol Herbst Part-of: --- meson.build | 4 +-- .../frontends/clover/llvm/codegen/bitcode.cpp | 4 --- src/gallium/frontends/clover/llvm/compat.hpp | 33 +------------------ 3 files changed, 2 insertions(+), 39 deletions(-) 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 } } }