pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
JIT works only partially with meson build?
10+ messages / 4 participants
[nested] [flat]

Commit outlook (model estimate bayes-2.0, computed 2026-11-02; about the patch, not a person):
  Unhealthy, not receiving community buy-in.
  The activity on this thread indicates a low probability (8%) of commit in PG20-3 (closes 2026-11-30), and medium (28%) for PG20 (feature freeze 2027-04-08).
  Seek out Greg Sabino Mullane and Robert Haas or Daniel Gustafsson or David Rowley or Tom Lane (committers): they have history with this code.
  What the estimate rests on: prior cfs 7.0 (lowers it), file commits 1y 0.0 (raises it), final cf 0.0 (lowers it), age days 6.265 (lowers it)
* JIT works only partially with meson build?
@ 2025-05-26 06:08 Yugo Nagata <nagata@sraoss.co.jp>
  2025-05-26 07:17 ` Re: JIT works only partially with meson build? David Rowley <dgrowleyml@gmail.com>
  0 siblings, 1 reply; 10+ messages in thread

From: Yugo Nagata @ 2025-05-26 06:08 UTC (permalink / raw)
  To: pgsql-hackers

Hi,

While building PostgreSQL 17 on Windows, I noticed bitcode files (.bc) are not
generated with meson. Does this means that "inlining" of JIT doesn't
work when PostgreSQL is build with meson?

If so, is it better to describe that in the meson build and JIT sections in the
documentation so that users and packagers would except JIT doesn't work in the same
way when built with meson and autoconf/make?

Regards,
Yugo Nagata

-- 
Yugo Nagata <nagata@sraoss.co.jp>





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: JIT works only partially with meson build?
  2025-05-26 06:08 JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
@ 2025-05-26 07:17 ` David Rowley <dgrowleyml@gmail.com>
  2025-06-27 07:19   ` Re: JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  0 siblings, 1 reply; 10+ messages in thread

From: David Rowley @ 2025-05-26 07:17 UTC (permalink / raw)
  To: Yugo Nagata <nagata@sraoss.co.jp>; +Cc: pgsql-hackers

On Mon, 26 May 2025 at 18:08, Yugo Nagata <nagata@sraoss.co.jp> wrote:
> While building PostgreSQL 17 on Windows, I noticed bitcode files (.bc) are not
> generated with meson. Does this means that "inlining" of JIT doesn't
> work when PostgreSQL is build with meson?

Yes.  I believe [1] aims to fix this.

David

[1] https://commitfest.postgresql.org/patch/5671/





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: JIT works only partially with meson build?
  2025-05-26 06:08 JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  2025-05-26 07:17 ` Re: JIT works only partially with meson build? David Rowley <dgrowleyml@gmail.com>
@ 2025-06-27 07:19   ` Yugo Nagata <nagata@sraoss.co.jp>
  2025-09-30 12:04     ` Re: JIT works only partially with meson build? Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 10+ messages in thread

From: Yugo Nagata @ 2025-06-27 07:19 UTC (permalink / raw)
  To: David Rowley <dgrowleyml@gmail.com>; +Cc: pgsql-hackers

On Mon, 26 May 2025 19:17:53 +1200
David Rowley <dgrowleyml@gmail.com> wrote:

> On Mon, 26 May 2025 at 18:08, Yugo Nagata <nagata@sraoss.co.jp> wrote:
> > While building PostgreSQL 17 on Windows, I noticed bitcode files (.bc) are not
> > generated with meson. Does this means that "inlining" of JIT doesn't
> > work when PostgreSQL is build with meson?
> 
> Yes.  I believe [1] aims to fix this.
> 
> David
> 
> [1] https://commitfest.postgresql.org/patch/5671/

Thank you for the clarification.

I've attached a patch to update the documentation.
I believe it's worth stating this explicitly, since the fix will not be
applied until at the earliest PostgreSQL 19.

Regards,
Yugo Nagata

-- 
Yugo Nagata <nagata@sraoss.co.jp>

Attachments:

fix_doc_jit_meson.patch (text/x-diff, 1.2K) download diff --git a/doc/src/sgml/jit.sgml b/doc/src/sgml/jit.sgml index 44e18bf1a6f..00092675288 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"><literal>--with-llvm</literal></link> + or <link linkend="configure-with-llvm-meson"><option>-Dllvm</option></link>. </para> <para> @@ -76,6 +77,15 @@ 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. + See <xref linkend="jit-extensibility-bitcode"/> for more details about bitcode. + </para> + </note> </sect2> <sect2 id="jit-optimization">
^ permalink raw reply [nested|flat] 10+ messages in thread

* Re: JIT works only partially with meson build?
  2025-05-26 06:08 JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  2025-05-26 07:17 ` Re: JIT works only partially with meson build? David Rowley <dgrowleyml@gmail.com>
  2025-06-27 07:19   ` Re: JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
@ 2025-09-30 12:04     ` Laurenz Albe <laurenz.albe@cybertec.at>
  2025-09-30 13:31       ` Re: JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  0 siblings, 1 reply; 10+ messages in thread

From: Laurenz Albe @ 2025-09-30 12:04 UTC (permalink / raw)
  To: Yugo Nagata <nagata@sraoss.co.jp>; David Rowley <dgrowleyml@gmail.com>; +Cc: pgsql-hackers

On Fri, 2025-06-27 at 16:19 +0900, Yugo Nagata wrote:
> On Mon, 26 May 2025 19:17:53 +1200
> David Rowley <dgrowleyml@gmail.com> wrote:
> 
> > On Mon, 26 May 2025 at 18:08, Yugo Nagata <nagata@sraoss.co.jp> wrote:
> > > While building PostgreSQL 17 on Windows, I noticed bitcode files (.bc) are not
> > > generated with meson. Does this means that "inlining" of JIT doesn't
> > > work when PostgreSQL is build with meson?
> > 
> > Yes.  I believe [1] aims to fix this.
> > 
> > [1] https://commitfest.postgresql.org/patch/5671/
> 
> Thank you for the clarification.
> 
> I've attached a patch to update the documentation.
> I believe it's worth stating this explicitly, since the fix will not be
> applied until at the earliest PostgreSQL 19.

I think that it is a good idea to document this lack of functionality.

One thing stood out to me:

> --- 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"><literal>--with-llvm</literal></link>
> +   or <link linkend="configure-with-llvm-meson"><option>-Dllvm</option></link>.

You used the <option> tag, which I believe is correct, but the surrounding
code uses <literal>.  I don't think it renders differently, but I think it
would be good to use the same tag.  I suggest that you change the
surrounding code to use <option> as well.

v18 is already shipped, and we don't know if the patch to produce bitcode
with Meson will make v19 or not.  Consequently, I don't know if we should
apply the patch to git HEAD yet.  But I believe that it should be
backpatched to all older releases, since this is a shortcoming in the
documentation.

Yours,
Laurenz Albe





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: JIT works only partially with meson build?
  2025-05-26 06:08 JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  2025-05-26 07:17 ` Re: JIT works only partially with meson build? David Rowley <dgrowleyml@gmail.com>
  2025-06-27 07:19   ` Re: JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  2025-09-30 12:04     ` Re: JIT works only partially with meson build? Laurenz Albe <laurenz.albe@cybertec.at>
@ 2025-09-30 13:31       ` Yugo Nagata <nagata@sraoss.co.jp>
  2025-10-01 13:25         ` Re: JIT works only partially with meson build? Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 10+ messages in thread

From: Yugo Nagata @ 2025-09-30 13:31 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: David Rowley <dgrowleyml@gmail.com>; pgsql-hackers

On Tue, 30 Sep 2025 14:04:13 +0200
Laurenz Albe <laurenz.albe@cybertec.at> wrote:

> On Fri, 2025-06-27 at 16:19 +0900, Yugo Nagata wrote:
> > On Mon, 26 May 2025 19:17:53 +1200
> > David Rowley <dgrowleyml@gmail.com> wrote:
> > 
> > > On Mon, 26 May 2025 at 18:08, Yugo Nagata <nagata@sraoss.co.jp> wrote:
> > > > While building PostgreSQL 17 on Windows, I noticed bitcode files (.bc) are not
> > > > generated with meson. Does this means that "inlining" of JIT doesn't
> > > > work when PostgreSQL is build with meson?
> > > 
> > > Yes.  I believe [1] aims to fix this.
> > > 
> > > [1] https://commitfest.postgresql.org/patch/5671/
> > 
> > Thank you for the clarification.
> > 
> > I've attached a patch to update the documentation.
> > I believe it's worth stating this explicitly, since the fix will not be
> > applied until at the earliest PostgreSQL 19.
> 
> I think that it is a good idea to document this lack of functionality.

Thank you for taking a look at it.

> One thing stood out to me:
> 
> > --- 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"><literal>--with-llvm</literal></link>
> > +   or <link linkend="configure-with-llvm-meson"><option>-Dllvm</option></link>.
> 
> You used the <option> tag, which I believe is correct, but the surrounding
> code uses <literal>.  I don't think it renders differently, but I think it
> would be good to use the same tag.  I suggest that you change the
> surrounding code to use <option> as well.

Agreed. I fixed it to use <option>, as well as in other place where I think
<option> is appropriate. Please find the attached patch.

> v18 is already shipped, and we don't know if the patch to produce bitcode
> with Meson will make v19 or not.  Consequently, I don't know if we should
> apply the patch to git HEAD yet.  But I believe that it should be
> backpatched to all older releases, since this is a shortcoming in the
> documentation.

+1.

Regards,
Yugo Nagata

-- 
Yugo Nagata <nagata@sraoss.co.jp>

Attachments:

v2_fix_doc_jit_meson.patch (text/x-diff, 1.8K) download diff --git a/doc/src/sgml/jit.sgml b/doc/src/sgml/jit.sgml index 44e18bf1a6f..d5373061e3a 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,15 @@ 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. + See <xref linkend="jit-extensibility-bitcode"/> for more details about bitcode. + </para> + </note> </sect2> <sect2 id="jit-optimization"> @@ -133,7 +143,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.
^ permalink raw reply [nested|flat] 10+ messages in thread

* Re: JIT works only partially with meson build?
  2025-05-26 06:08 JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  2025-05-26 07:17 ` Re: JIT works only partially with meson build? David Rowley <dgrowleyml@gmail.com>
  2025-06-27 07:19   ` Re: JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  2025-09-30 12:04     ` Re: JIT works only partially with meson build? Laurenz Albe <laurenz.albe@cybertec.at>
  2025-09-30 13:31       ` Re: JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
@ 2025-10-01 13:25         ` Laurenz Albe <laurenz.albe@cybertec.at>
  2026-07-27 05:36           ` Re: JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  0 siblings, 1 reply; 10+ messages in thread

From: Laurenz Albe @ 2025-10-01 13:25 UTC (permalink / raw)
  To: Yugo Nagata <nagata@sraoss.co.jp>; +Cc: David Rowley <dgrowleyml@gmail.com>; pgsql-hackers

On Tue, 2025-09-30 at 22:31 +0900, Yugo Nagata wrote:
> > You used the <option> tag, which I believe is correct, but the surrounding
> > code uses <literal>.  I don't think it renders differently, but I think it
> > would be good to use the same tag.  I suggest that you change the
> > surrounding code to use <option> as well.
> 
> Agreed. I fixed it to use <option>, as well as in other place where I think
> <option> is appropriate. Please find the attached patch.

I'll mark it "eeady for committer".  A committer can decide whether to apply
this to HEAD or not.  I probably would, and revert it if PostgreSQL + Meson +
Windows learns to produce bitcode.

Yours,
Laurenz Albe





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: JIT works only partially with meson build?
  2025-05-26 06:08 JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  2025-05-26 07:17 ` Re: JIT works only partially with meson build? David Rowley <dgrowleyml@gmail.com>
  2025-06-27 07:19   ` Re: JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  2025-09-30 12:04     ` Re: JIT works only partially with meson build? Laurenz Albe <laurenz.albe@cybertec.at>
  2025-09-30 13:31       ` Re: JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  2025-10-01 13:25         ` Re: JIT works only partially with meson build? Laurenz Albe <laurenz.albe@cybertec.at>
@ 2026-07-27 05:36           ` Yugo Nagata <nagata@sraoss.co.jp>
  2026-09-18 02:13             ` Re: JIT works only partially with meson build? shihao zhong <zhong950419@gmail.com>
  0 siblings, 1 reply; 10+ messages in thread

From: Yugo Nagata @ 2026-07-27 05:36 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: David Rowley <dgrowleyml@gmail.com>; pgsql-hackers

On Wed, 01 Oct 2025 15:25:51 +0200
Laurenz Albe <laurenz.albe@cybertec.at> wrote:

> On Tue, 2025-09-30 at 22:31 +0900, Yugo Nagata wrote:
> > > You used the <option> tag, which I believe is correct, but the surrounding
> > > code uses <literal>.  I don't think it renders differently, but I think it
> > > would be good to use the same tag.  I suggest that you change the
> > > surrounding code to use <option> as well.
> > 
> > Agreed. I fixed it to use <option>, as well as in other place where I think
> > <option> is appropriate. Please find the attached patch.

I'm just resending the same patch because CommitFest reports that it needs a
rebase, although it still applies cleanly.

Regards,
Yugo Nagata

> 
> I'll mark it "eeady for committer".  A committer can decide whether to apply
> this to HEAD or not.  I probably would, and revert it if PostgreSQL + Meson +
> Windows learns to produce bitcode.
> 
> Yours,
> Laurenz Albe

-- 
Yugo Nagata <nagata@sraoss.co.jp>

Attachments:

v2_fix_doc_jit_meson.patch (text/x-diff, 1.8K) download diff --git a/doc/src/sgml/jit.sgml b/doc/src/sgml/jit.sgml index 44e18bf1a6f..d5373061e3a 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,15 @@ 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. + See <xref linkend="jit-extensibility-bitcode"/> for more details about bitcode. + </para> + </note> </sect2> <sect2 id="jit-optimization"> @@ -133,7 +143,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.
^ permalink raw reply [nested|flat] 10+ messages in thread

* Re: JIT works only partially with meson build?
  2025-05-26 06:08 JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  2025-05-26 07:17 ` Re: JIT works only partially with meson build? David Rowley <dgrowleyml@gmail.com>
  2025-06-27 07:19   ` Re: JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  2025-09-30 12:04     ` Re: JIT works only partially with meson build? Laurenz Albe <laurenz.albe@cybertec.at>
  2025-09-30 13:31       ` Re: JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  2025-10-01 13:25         ` Re: JIT works only partially with meson build? Laurenz Albe <laurenz.albe@cybertec.at>
  2026-07-27 05:36           ` Re: JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
@ 2026-09-18 02:13             ` shihao zhong <zhong950419@gmail.com>
  2026-09-18 12:00               ` Re: JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  0 siblings, 1 reply; 10+ messages in thread

From: shihao zhong @ 2026-09-18 02:13 UTC (permalink / raw)
  To: Yugo Nagata <nagata@sraoss.co.jp>; +Cc: Laurenz Albe <laurenz.albe@cybertec.at>; David Rowley <dgrowleyml@gmail.com>; pgsql-hackers

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.

Regards,
Shihao

Attachments:

v3_fix_doc_jit_meson.patch (application/octet-stream, 2.6K) download From 5ce61e5d788962f5fae3b0b8d667d4068f316194 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 v3] 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> Discussion: https://postgr.es/m/20250526150820.28ea70625645e0d6d12be7d5@sraoss.co.jp Backpatch-through: 16 --- doc/src/sgml/jit.sgml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/doc/src/sgml/jit.sgml b/doc/src/sgml/jit.sgml index 44e18bf1a6f..d5373061e3a 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,15 @@ 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. + See <xref linkend="jit-extensibility-bitcode"/> for more details about bitcode. + </para> + </note> </sect2> <sect2 id="jit-optimization"> @@ -133,7 +143,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.37.1 (Apple Git-137.1)
^ permalink raw reply [nested|flat] 10+ messages in thread

* Re: JIT works only partially with meson build?
  2025-05-26 06:08 JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  2025-05-26 07:17 ` Re: JIT works only partially with meson build? David Rowley <dgrowleyml@gmail.com>
  2025-06-27 07:19   ` Re: JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  2025-09-30 12:04     ` Re: JIT works only partially with meson build? Laurenz Albe <laurenz.albe@cybertec.at>
  2025-09-30 13:31       ` Re: JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  2025-10-01 13:25         ` Re: JIT works only partially with meson build? Laurenz Albe <laurenz.albe@cybertec.at>
  2026-07-27 05:36           ` Re: JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  2026-09-18 02:13             ` Re: JIT works only partially with meson build? shihao zhong <zhong950419@gmail.com>
@ 2026-09-18 12:00               ` Yugo Nagata <nagata@sraoss.co.jp>
  2026-09-18 16:10                 ` Re: JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  0 siblings, 1 reply; 10+ messages in thread

From: Yugo Nagata @ 2026-09-18 12:00 UTC (permalink / raw)
  To: shihao zhong <zhong950419@gmail.com>; +Cc: Laurenz Albe <laurenz.albe@cybertec.at>; David Rowley <dgrowleyml@gmail.com>; pgsql-hackers

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:

v4-0001-doc-Mention-that-JIT-inlining-does-not-work-with-.patch (text/x-diff, 2.7K) download 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.sgml index 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
^ permalink raw reply [nested|flat] 10+ messages in thread

* Re: JIT works only partially with meson build?
  2025-05-26 06:08 JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  2025-05-26 07:17 ` Re: JIT works only partially with meson build? David Rowley <dgrowleyml@gmail.com>
  2025-06-27 07:19   ` Re: JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  2025-09-30 12:04     ` Re: JIT works only partially with meson build? Laurenz Albe <laurenz.albe@cybertec.at>
  2025-09-30 13:31       ` Re: JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  2025-10-01 13:25         ` Re: JIT works only partially with meson build? Laurenz Albe <laurenz.albe@cybertec.at>
  2026-07-27 05:36           ` Re: JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
  2026-09-18 02:13             ` Re: JIT works only partially with meson build? shihao zhong <zhong950419@gmail.com>
  2026-09-18 12:00               ` Re: JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
@ 2026-09-18 16:10                 ` Yugo Nagata <nagata@sraoss.co.jp>
  0 siblings, 0 replies; 10+ messages in thread

From: Yugo Nagata @ 2026-09-18 16:10 UTC (permalink / raw)
  To: Yugo Nagata <nagata@sraoss.co.jp>; +Cc: shihao zhong <zhong950419@gmail.com>; Laurenz Albe <laurenz.albe@cybertec.at>; David Rowley <dgrowleyml@gmail.com>; pgsql-hackers

On Fri, 18 Sep 2026 21:00:20 +0900
Yugo Nagata <nagata@sraoss.co.jp> wrote:

> 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.

It may be unnecessary once the LLVM bitcode emission patches [1] are
committed, though.

[1] https://www.postgresql.org/message-id/flat/CAN55FZ26ohMftt20NUtVAxU8Feqjhz-jEfUvFKATYEaRR%2Bxmqg%40m...

Regards,
Yugo Nagata

-- 
Yugo Nagata <nagata@sraoss.co.jp>






^ permalink  raw  reply  [nested|flat] 10+ messages in thread


end of thread, other threads:[~2026-09-18 16:10 UTC | newest]

Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-05-26 06:08 JIT works only partially with meson build? Yugo Nagata <nagata@sraoss.co.jp>
2025-05-26 07:17 ` David Rowley <dgrowleyml@gmail.com>
2025-06-27 07:19   ` Yugo Nagata <nagata@sraoss.co.jp>
2025-09-30 12:04     ` Laurenz Albe <laurenz.albe@cybertec.at>
2025-09-30 13:31       ` Yugo Nagata <nagata@sraoss.co.jp>
2025-10-01 13:25         ` Laurenz Albe <laurenz.albe@cybertec.at>
2026-07-27 05:36           ` Yugo Nagata <nagata@sraoss.co.jp>
2026-09-18 02:13             ` shihao zhong <zhong950419@gmail.com>
2026-09-18 12:00               ` Yugo Nagata <nagata@sraoss.co.jp>
2026-09-18 16:10                 ` Yugo Nagata <nagata@sraoss.co.jp>

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