public inbox for [email protected]  
help / color / mirror / Atom feed
From: Andres Freund <[email protected]>
To: Thomas Munro <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: Devrim Gündüz <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: Matheus Alcantara <[email protected]>
Cc: Anthonin Bonnefoy <[email protected]>
Subject: Re: LLVM 22
Date: Thu, 2 Apr 2026 10:31:48 -0400
Message-ID: <zv7wuadyqnxkl4tqlwzvrwghntn4ntgx4tn7s6cjyn354qp56e@wvf3yyibmpc6> (raw)
In-Reply-To: <CA+hUKGJFVyQA8QOjB3BSuq9N1VbTvMPzsFG93p=4TmLR8R58zA@mail.gmail.com>
References: <CA+hUKGJTumad75o8Zao-LFseEbt=enbUFCM7LZVV=c8yg2i7dg@mail.gmail.com>
	<CA+hUKGJv+QUOy8yOHe_0VfRGTSrHaCvo0xZG-1JGTqBurcPkOw@mail.gmail.com>
	<CA+hUKGLJ63fpt_u0OXDR91fbpicDXK01fivzDSBMOtPazEanFQ@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<CA+hUKGL1LfD7BTACTx=E78gq_jiFU727osd6tHCnbERrqY8DOA@mail.gmail.com>
	<CA+hUKGJFVyQA8QOjB3BSuq9N1VbTvMPzsFG93p=4TmLR8R58zA@mail.gmail.com>

Hi,

On 2026-04-02 16:20:41 +1300, Thomas Munro wrote:
> On Wed, Apr 1, 2026 at 4:25 PM Thomas Munro <[email protected]> wrote:
> > Working on this, more shortly...  I'm trying to figure out if Anthonin
> > and Andres's feedback means the poison approach does nothing useful
> > and we might as well just #ifdef out the lifetime.end stuff for LLVM
> > >= 22 to fix the breakage today.
> 
> Done.  Hopefully midge and Devrim will now turn green :-)

Thanks!


> > Either way it looks like we need a patch to use alloca instead, which
> > I'll also look into...
> 
> I see a few options, but I need to hack on them for a while to figure
> out the tradeoffs, or what I'm missing...  after the freeze.

I've experimented a bunch with this, it seems we need the larger changes done
as part of the patchset for removing pointers from the expressions to actually
allow recent-ish LLVM to optimize this.  I did verify that what we did didn't
have an effect with any other recent LLVM either.

The real fix here might be to have a separate calling convention for the very
common case of a scalar stable function with 1-3 arguments.  We loose a fair
bit of efficiency even in interpreted execution due to ferrying arguments,
their nullness, and the nullness of the return value through memory.

Greetings,

Andres Freund





view thread (15+ messages)  latest in thread

reply

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: LLVM 22
  In-Reply-To: <zv7wuadyqnxkl4tqlwzvrwghntn4ntgx4tn7s6cjyn354qp56e@wvf3yyibmpc6>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox