Re: LLVM 16 (opaque pointers)

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Devrim Gündüz <devrim(at)gunduz(dot)org>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, Ronan Dunklau <ronan(dot)dunklau(at)aiven(dot)io>, Andres Freund <andres(at)anarazel(dot)de>, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
Subject: Re: LLVM 16 (opaque pointers)
Date: 2023-10-11 08:59:50
Message-ID: CA+hUKGJnG8jJJkyULpg1xTxzNtL2FreS4C16TFcRLwu8RR1yUQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Sep 21, 2023 at 12:47 PM Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote:
> On Thu, Sep 21, 2023 at 12:24 PM Devrim Gündüz <devrim(at)gunduz(dot)org> wrote:
> > RHEL releases new LLVM version along with their new minor releases every
> > 6 month, and we have to build older versions with new LLVM each time.
> > From RHEL point of view, it would be great if we can back-patch back to
> > v12 :(
>
> Got it. OK, I'll work on 12 and 13 now.

The back-patch to 12 was a little trickier than anticipated, but after
taking a break and trying again I now have PG 12...17 patches that
I've tested against LLVM 10...18 (that's 54 combinations), in every
case only with the clang corresponding to LLVM.

For 12, I decided to back-patch the llvm_types_module variable that
was introduced in 13, to keep the code more similar.

For master, I had to rebase over Daniel's recent commits, which
required re-adding unused variables removed by 2dad308e, and
then changing a bunch of LLVM type constructors like LLVMInt8Type() to
the LLVMInt8TypeInContext(lc, ...) variants following the example of
9dce2203. Without that, type assertions in my LLVM 18 debug build
would fail (and maybe there could be a leak problem, though I'm not
sure that really applied to integer (non-struct) types).

I've attached only the patches for master, but the 12-16 versions are
available at https://github.com/macdice/postgres/tree/llvm16-$N in
case anyone has comments on those.

Attachment Content-Type Size
v3-0001-jit-Support-opaque-pointers-in-LLVM-16.patch application/x-patch 60.0 KB
v3-0002-jit-Changes-for-LLVM-17.patch application/x-patch 3.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message tender wang 2023-10-11 09:06:29 Re: Problem, partition pruning for prepared statement with IS NULL clause.
Previous Message Michael Paquier 2023-10-11 08:37:42 Re: False "pg_serial": apparent wraparound” in logs