]> git.ipfire.org Git - thirdparty/postgresql.git/commit
jit: Stop emitting lifetime.end for LLVM 22.
authorThomas Munro <tmunro@postgresql.org>
Thu, 2 Apr 2026 02:24:44 +0000 (15:24 +1300)
committerThomas Munro <tmunro@postgresql.org>
Thu, 2 Apr 2026 02:54:01 +0000 (15:54 +1300)
commit78cea19bf7daa16e8fff4d1bb69a349fcc1421f3
tree7bb570bb511720fc17509acfff6e7bc49c73cd35
parent9ed5015f0d84ad62a15b4f468d743d1f8ec93a5e
jit: Stop emitting lifetime.end for LLVM 22.

The lifetime.end intrinsic can now only be used for stack memory
allocated with alloca[1][2][3].  We use it to tell LLVM about the
lifetime of function arguments/isnull values that we keep in palloc'd
memory, so that it can avoid spilling registers to memory.

We might need to rearrange things and put them on the stack, but that'll
take some research.  In the meantime, unbreak the build on LLVM 22.

[1] https://github.com/llvm/llvm-project/pull/149310
[2] https://llvm.org/docs/LangRef.html#llvm-lifetime-end-intrinsic
[3] https://llvm.org/docs/LangRef.html#i-alloca

Backpatch-through: 14
Reviewed-by: Matheus Alcantara <matheusssilv97@gmail.com> (earlier attempt)
Reviewed-by: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com> (earlier attempt)
Reviewed-by: Andres Freund <andres@anarazel.de> (earlier attempt)
Discussion: https://postgr.es/m/CA%2BhUKGJTumad75o8Zao-LFseEbt%3DenbUFCM7LZVV%3Dc8yg2i7dg%40mail.gmail.com
src/backend/jit/llvm/llvmjit_expr.c