From: Yugo Nagata <nagata@sraoss.co.jp>
To: shihao zhong <zhong950419@gmail.com>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: David Rowley <dgrowleyml@gmail.com>
Cc: Pgsql Hackers <pgsql-hackers@postgresql.org>
Subject: Re: JIT works only partially with meson build?
Date: Fri, 18 Sep 2026 21:00:20 +0900
Message-ID: <20260918210020.35cd930ad036a9b53b4b19f6@sraoss.co.jp> (raw)
In-Reply-To: <CAGRkXqQd26aCrGX03fXiV9MWZmAtYsFDd9N5HzHOxsiSfoKsXA@mail.gmail.com>
References: <20250526150820.28ea70625645e0d6d12be7d5@sraoss.co.jp>
<CAApHDvpGYzFows6Yc2j1XUEP-rFegMwA1tMkw-_DSuk0Opo7zw@mail.gmail.com>
<20250627161959.217df60b49a460e837275e51@sraoss.co.jp>
<09d61e56103fa319dbaf21fb3156ab9f16dbe25b.camel@cybertec.at>
<20250930223119.066336beb38fc93392442c20@sraoss.co.jp>
<5a88920da32b910fac64608980d8fe690a14d7d7.camel@cybertec.at>
<20260727143602.fe90eac5cc635b6d26888b7e@sraoss.co.jp>
<CAGRkXqQd26aCrGX03fXiV9MWZmAtYsFDd9N5HzHOxsiSfoKsXA@mail.gmail.com>
Hi Shihao,
On Thu, 17 Sep 2026 22:13:02 -0400
shihao zhong <zhong950419@gmail.com> wrote:
> Hi Yugo,
>
> cfbot fails because v2 is a plain diff, and git am cannot apply it.
> Attached v3 is the same change made with git format-patch, plus a
> commit message. It applies to master and REL_16_STABLE through
> REL_19_STABLE.
>
> One suggestion: EXPLAIN still shows "Inlining: true" in this case,
> since it only checks PGJIT_INLINE. Maybe the note should say so.
Thak you for updating the patch.
I've attached an updated path incorporating your suggestion.
Regards,]
Yugo Nagata
--
Yugo Nagata <nagata@sraoss.co.jp>
Attachments:
[text/x-diff] v4-0001-doc-Mention-that-JIT-inlining-does-not-work-with-.patch (2.7K, ../20260918210020.35cd930ad036a9b53b4b19f6@sraoss.co.jp/2-v4-0001-doc-Mention-that-JIT-inlining-does-not-work-with-.patch)
download | inline diff:
From 318250d9ec79502e038644bd4b73d1682cc1b561 Mon Sep 17 00:00:00 2001
From: Yugo Nagata <nagata@sraoss.co.jp>
Date: Thu, 17 Sep 2026 22:09:43 -0400
Subject: [PATCH v4] doc: Mention that JIT inlining does not work with Meson
builds
Meson builds do not generate the LLVM bitcode that JIT inlining
needs. So with -Dllvm, JIT compilation works, but inlining does
not. Document that in the JIT chapter, and mention -Dllvm next to
--with-llvm.
While at it, use <option> for --with-llvm, per review.
This should be reverted once Meson learns to build the bitcode.
Author: Yugo Nagata <nagata@sraoss.co.jp>
Reviewed-by: Laurenz Albe <laurenz.albe@cybertec.at>
Reviewed-by: shihao zhong <zhong950419@gmail.com>
Discussion: https://postgr.es/m/20250526150820.28ea70625645e0d6d12be7d5@sraoss.co.jp
Backpatch-through: 16
---
doc/src/sgml/jit.sgml | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/doc/src/sgml/jit.sgml b/doc/src/sgml/jit.sgmlindex 44e18bf1a6f..fb934ce6fac 100644--- a/doc/src/sgml/jit.sgml+++ b/doc/src/sgml/jit.sgml@@ -36,7 +36,8 @@
<acronym>JIT</acronym> compilation using <ulink
url="https://llvm.org/"><productname>LLVM</productname></ulink> when
<productname>PostgreSQL</productname> is built with
- <link linkend="configure-with-llvm"><literal>--with-llvm</literal></link>.+ <link linkend="configure-with-llvm"><option>--with-llvm</option></link>+ or <link linkend="configure-with-llvm-meson"><option>-Dllvm</option></link>.
</para>
<para>
@@ -76,6 +77,16 @@
bodies of small functions into the expressions using them. That allows a
significant percentage of the overhead to be optimized away.
</para>
+ <note>+ <para>+ Inlining does not work if <productname>PostgreSQL</productname> is built using+ <application>Meson</application> with+ <link linkend="configure-with-llvm-meson"><option>-Dllvm</option></link>,+ because the <productname>LLVM</productname> bitcode is not built,+ regardless of whether <command>EXPLAIN</command> shows "Inlining true".+ See <xref linkend="jit-extensibility-bitcode"/> for more details about bitcode.+ </para>+ </note>
</sect2>
<sect2 id="jit-optimization">
@@ -133,7 +144,7 @@
<para>
If <xref linkend="guc-jit"/> is set to <literal>off</literal>, or if no
<acronym>JIT</acronym> implementation is available (for example because
- the server was compiled without <literal>--with-llvm</literal>),+ the server was compiled without <option>--with-llvm</option>),
<acronym>JIT</acronym> will not be performed, even if it would be
beneficial based on the above criteria. Setting <xref linkend="guc-jit"/>
to <literal>off</literal> has effects at both plan and execution time.
--
2.43.0
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: nagata@sraoss.co.jp, zhong950419@gmail.com, laurenz.albe@cybertec.at, dgrowleyml@gmail.com
Subject: Re: JIT works only partially with meson build?
In-Reply-To: <20260918210020.35cd930ad036a9b53b4b19f6@sraoss.co.jp>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox