Re: LLVM 16 (opaque pointers)

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Devrim Gündüz <devrim@gunduz.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Fabien COELHO <coelho@cri.ensmp.fr>, Ronan Dunklau <ronan.dunklau@aiven.io>, Dmitry Dolgov <9erthalion6@gmail.com>
Date: 2023-10-12T23:31:20Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. jit: Adjust back-patch of f90b4a84 to 12 and 13.

  2. Log LLVM library version in configure output.

  3. jit: Changes for LLVM 17.

  4. jit: Supply LLVMGlobalGetValueType() for LLVM < 8.

  5. jit: Support opaque pointers in LLVM 16.

  6. jit: Reference function pointer types via llvmjit_types.c.

Hi,

On 2023-10-11 21:59:50 +1300, Thomas Munro wrote:
> +#else
> +	LLVMPassBuilderOptionsRef options;
> +	LLVMErrorRef err;
> +	int			compile_optlevel;
> +	char	   *passes;
> +
> +	if (context->base.flags & PGJIT_OPT3)
> +		compile_optlevel = 3;
> +	else
> +		compile_optlevel = 0;
> +
> +	passes = psprintf("default<O%d>,mem2reg,function(no-op-function),no-op-module",
> +					  compile_optlevel);

I don't think the "function(no-op-function),no-op-module" bit does something
particularly useful?

I also don't think we should add the mem2reg pass outside of -O0 - running it
after a real optimization pipeline doesn't seem useful and might even make the
code worse? mem2reg is included in default<O1> (and obviously also in O3).


Thanks for working on this stuff!


I'm working on setting up buildfarm animals for 16, 17, each once with
a normal and an assertion enabled LLVM build.

Greetings,

Andres Freund