Re: Optimizing PostgreSQL with LLVM's PGO+LTO

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: João Paulo Labegalini de Carvalho <jaopaulolc(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Optimizing PostgreSQL with LLVM's PGO+LTO
Date: 2023-01-27 20:06:37
Message-ID: 3530277.1674849997@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

=?UTF-8?Q?Jo=C3=A3o_Paulo_Labegalini_de_Carvalho?= <jaopaulolc(at)gmail(dot)com> writes:
> I am facing issues when applying LTO to PostgreSQL as the produced binary
> seems broken (the server dies quickly after it has started). This is
> definitely a compiler bug, but I was wondering if anyone here have
> experimented with LTO for PostgreSQL.

There are a lot of places where we're implicitly relying on
cross-compilation-unit optimizations NOT happening, because the
code isn't adequately decorated with memory barriers and the like.
So I wouldn't necessarily assume that the misbehavior you're seeing
represents anything that the compiler folks would consider a bug.

In the long run we might be interested in trying to make this
work better, but I don't know of anyone working on it now.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Cary Huang 2023-01-27 20:13:32 Re: Authentication fails for md5 connections if ~/.postgresql/postgresql.{crt and key} exist
Previous Message Robert Haas 2023-01-27 20:05:20 Re: Set arbitrary GUC options during initdb