]> git.ipfire.org Git - thirdparty/postgresql.git/commit
jit: No backport::SectionMemoryManager for LLVM 22.
authorThomas Munro <tmunro@postgresql.org>
Fri, 3 Apr 2026 01:48:54 +0000 (14:48 +1300)
committerThomas Munro <tmunro@postgresql.org>
Fri, 3 Apr 2026 02:02:45 +0000 (15:02 +1300)
commit963fccc09cc6b3fe6f0a6246e5af16c9d9af100d
tree488b61b650fc63dc372ad7c3c2c095d4c84e0761
parentc00ea2b5b4f16496d0f8545266af0b9945e54800
jit: No backport::SectionMemoryManager for LLVM 22.

LLVM 22 has the fix that we copied into our tree in commit 9044fc1d and
a new function to reach it[1][2], so we only need to use our copy for
Aarch64 + LLVM < 22.  The only change to the final version that our copy
didn't get is a new LLVM_ABI macro, but that isn't appropriate for us.
Our copy is hopefully now frozen and would only need maintenance if bugs
are found in the upstream code.

Non-Aarch64 systems now also use the new API with LLVM 22.  It allocates
all sections with one contiguous mmap() instead of one per
section.  We could have done that earlier, but commit 9044fc1d wanted to
limit the blast radius to the affected systems.  We might as well
benefit from that small improvement everywhere now that it is available
out of the box.

We can't delete our copy until LLVM 22 is our minimum supported version,
or we switch to the newer JITLink API for at least Aarch64.

[1] https://github.com/llvm/llvm-project/pull/71968
[2] https://github.com/llvm/llvm-project/pull/174307

Backpatch-through: 14
Discussion: https://postgr.es/m/CA%2BhUKGJTumad75o8Zao-LFseEbt%3DenbUFCM7LZVV%3Dc8yg2i7dg%40mail.gmail.com
src/backend/jit/llvm/SectionMemoryManager.cpp
src/backend/jit/llvm/llvmjit.c
src/include/jit/SectionMemoryManager.h
src/include/jit/llvmjit_backport.h