mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 15:20:10 +01:00
chore(deps): clover: raise the minimum LLVM version to 11.0.0
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 <kai@dev.carbon-project.org> Reviewed-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16047>
This commit is contained in:
parent
98ba1e0d81
commit
559c027ade
3 changed files with 2 additions and 39 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -41,12 +41,8 @@
|
|||
|
||||
#include <map>
|
||||
#include <llvm/Config/llvm-config.h>
|
||||
#if LLVM_VERSION_MAJOR < 4
|
||||
#include <llvm/Bitcode/ReaderWriter.h>
|
||||
#else
|
||||
#include <llvm/Bitcode/BitcodeReader.h>
|
||||
#include <llvm/Bitcode/BitcodeWriter.h>
|
||||
#endif
|
||||
#include <llvm/Support/raw_ostream.h>
|
||||
|
||||
using clover::binary;
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
#include <llvm/IR/LLVMContext.h>
|
||||
#include <llvm/IR/Type.h>
|
||||
#include <llvm/Linker/Linker.h>
|
||||
#include <llvm/Support/CodeGen.h>
|
||||
#include <llvm/Target/TargetMachine.h>
|
||||
#include <llvm/Transforms/IPO.h>
|
||||
#include <llvm/Transforms/Utils/Cloning.h>
|
||||
|
|
@ -52,10 +53,6 @@
|
|||
#include <clang/Frontend/CompilerInstance.h>
|
||||
#include <clang/Lex/PreprocessorOptions.h>
|
||||
|
||||
#if LLVM_VERSION_MAJOR >= 10
|
||||
#include <llvm/Support/CodeGen.h>
|
||||
#endif
|
||||
|
||||
#if LLVM_VERSION_MAJOR >= 14
|
||||
#include <llvm/MC/TargetRegistry.h>
|
||||
#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<typename T> 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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue