diff options
author | Thomas Munro <tmunro@postgresql.org> | 2024-01-25 15:23:04 +1300 |
---|---|---|
committer | Thomas Munro <tmunro@postgresql.org> | 2024-01-25 15:42:34 +1300 |
commit | 820b5af73dcc6a5d0db6a98a62a6b859e5d107b6 (patch) | |
tree | cc46c2147142da3b000398e001ea2315ff3e298e /src/backend/jit/llvm/llvmjit_inline.cpp | |
parent | 729439607ad210dbb446e31754e8627d7e3f7dda (diff) | |
download | postgresql-820b5af73dcc6a5d0db6a98a62a6b859e5d107b6.tar.gz postgresql-820b5af73dcc6a5d0db6a98a62a6b859e5d107b6.zip |
jit: Require at least LLVM 10.
Remove support for older LLVM versions. The default on common software
distributions will be at least LLVM 10 when PostgreSQL 17 ships.
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://postgr.es/m/CA%2BhUKGLhNs5geZaVNj2EJ79Dx9W8fyWUU3HxcpZy55sMGcY%3DiA%40mail.gmail.com
Diffstat (limited to 'src/backend/jit/llvm/llvmjit_inline.cpp')
-rw-r--r-- | src/backend/jit/llvm/llvmjit_inline.cpp | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/src/backend/jit/llvm/llvmjit_inline.cpp b/src/backend/jit/llvm/llvmjit_inline.cpp index c9efc0bc994..2007eb523c9 100644 --- a/src/backend/jit/llvm/llvmjit_inline.cpp +++ b/src/backend/jit/llvm/llvmjit_inline.cpp @@ -49,12 +49,7 @@ extern "C" #include <llvm/ADT/StringSet.h> #include <llvm/ADT/StringMap.h> #include <llvm/Analysis/ModuleSummaryAnalysis.h> -#if LLVM_VERSION_MAJOR > 3 #include <llvm/Bitcode/BitcodeReader.h> -#else -#include <llvm/Bitcode/ReaderWriter.h> -#include <llvm/Support/Error.h> -#endif #include <llvm/IR/Attributes.h> #include <llvm/IR/DebugInfo.h> #include <llvm/IR/IntrinsicInst.h> @@ -267,14 +262,12 @@ llvm_build_inline_plan(LLVMContextRef lc, llvm::Module *mod) fs = llvm::cast<llvm::FunctionSummary>(gvs); -#if LLVM_VERSION_MAJOR > 3 if (gvs->notEligibleToImport()) { ilog(DEBUG1, "ineligibile to import %s due to summary", symbolName.data()); continue; } -#endif if ((int) fs->instCount() > inlineState.costLimit) { @@ -458,16 +451,9 @@ llvm_execute_inline_plan(llvm::Module *mod, ImportMapTy *globalsToInline) } -#if LLVM_VERSION_MAJOR > 4 -#define IRMOVE_PARAMS , /*IsPerformingImport=*/false -#elif LLVM_VERSION_MAJOR > 3 -#define IRMOVE_PARAMS , /*LinkModuleInlineAsm=*/false, /*IsPerformingImport=*/false -#else -#define IRMOVE_PARAMS -#endif if (Mover.move(std::move(importMod), GlobalsToImport.getArrayRef(), - [](llvm::GlobalValue &, llvm::IRMover::ValueAdder) {} - IRMOVE_PARAMS)) + [](llvm::GlobalValue &, llvm::IRMover::ValueAdder) {}, + /*IsPerformingImport=*/false)) elog(FATAL, "function import failed with linker error"); } } @@ -793,7 +779,6 @@ llvm_load_summary(llvm::StringRef path) { llvm::MemoryBufferRef ref(*MBOrErr.get().get()); -#if LLVM_VERSION_MAJOR > 3 llvm::Expected<std::unique_ptr<llvm::ModuleSummaryIndex> > IndexOrErr = llvm::getModuleSummaryIndex(ref); if (IndexOrErr) @@ -801,15 +786,6 @@ llvm_load_summary(llvm::StringRef path) elog(FATAL, "failed to load summary \"%s\": %s", path.data(), toString(IndexOrErr.takeError()).c_str()); -#else - llvm::ErrorOr<std::unique_ptr<llvm::ModuleSummaryIndex> > IndexOrErr = - llvm::getModuleSummaryIndex(ref, [](const llvm::DiagnosticInfo &) {}); - if (IndexOrErr) - return std::move(IndexOrErr.get()); - elog(FATAL, "failed to load summary \"%s\": %s", - path.data(), - IndexOrErr.getError().message().c_str()); -#endif } return nullptr; } @@ -856,22 +832,12 @@ summaries_for_guid(const InlineSearchPath& path, llvm::GlobalValue::GUID guid) for (auto index : path) { -#if LLVM_VERSION_MAJOR > 4 llvm::ValueInfo funcVI = index->getValueInfo(guid); /* if index doesn't know function, we don't have a body, continue */ if (funcVI) for (auto &gv : funcVI.getSummaryList()) matches.push_back(gv.get()); -#else - const llvm::const_gvsummary_iterator &I = - index->findGlobalValueSummaryList(guid); - if (I != index->end()) - { - for (auto &gv : I->second) - matches.push_back(gv.get()); - } -#endif } return matches; |