pgsql: jit: Stop emitting lifetime.end for LLVM 22. - Mailing list pgsql-committers

From Thomas Munro
Subject pgsql: jit: Stop emitting lifetime.end for LLVM 22.
Date
Msg-id E1w88Q3-002Y78-13@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/b4e7cd428c00cf0888d4cf2b2484026b05643766

Modified Files
--------------
src/backend/jit/llvm/llvmjit_expr.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)


pgsql-committers by date:

Previous
From: Thomas Munro
Date:
Subject: pgsql: jit: Stop emitting lifetime.end for LLVM 22.
Next
From: Amit Kapila
Date:
Subject: pgsql: Doc: Fix oversight in commit 55cefadde8.