Re: Optimizing PostgreSQL with LLVM's PGO+LTO

2023-02-01 Thread João Paulo Labegalini de Carvalho
On Mon, Jan 30, 2023 at 10:47 AM Andres Freund wrote: > For some reason my notes for using LTO include changing RANLIB to point to > gcc/llvm-ranlib of the appropriate version. Won't even be used on HEAD, but > before that it can make a difference. > I will try that. > Depending on how you bui

Re: Optimizing PostgreSQL with LLVM's PGO+LTO

2023-01-30 Thread João Paulo Labegalini de Carvalho
> What compiler / version / flags / OS did you try? > I am running experiment on a machine with: - Intel(R) Xeon(R) Platinum 8268 CPU @ 2.90GHz - Ubuntu 18.04.6 LTS - LLVM/Clang 15.0.6 (build from source) These are the flags I am using: CFLAGS = -O3 -fuse-ld=lld -gline-tables-only -fpr

Optimizing PostgreSQL with LLVM's PGO+LTO

2023-01-27 Thread João Paulo Labegalini de Carvalho
Hi all, I am investigating the benefits of different profile-guided optimizations (PGO) and link-time optimizations (LTO) versus binary optimizers (e.g. BOLT) for applications such as PostgreSQL. I am facing issues when applying LTO to PostgreSQL as the produced binary seems broken (the server di

Re: Query JITing with LLVM ORC

2022-09-21 Thread João Paulo Labegalini de Carvalho
ion. The reason I was looking at benchmarks is to have a workload to profile PostgreSQL and find its bottlenecks. The hot functions would then be outlined for JITing. On Wed., Sep. 21, 2022, 4:54 p.m. Thomas Munro, wrote: > On Thu, Sep 22, 2022 at 10:04 AM João Paulo Labegalini de Carva

Re: Query JITing with LLVM ORC

2022-09-21 Thread João Paulo Labegalini de Carvalho
Hi Thomas, It JITs expressions but not whole queries. Thanks for the clarification. > Query execution at the > tuple-flow level is still done using a C call stack the same shape as > the query plan, but it *could* be transformed to a different control > flow that could be run more efficiently

Query JITing with LLVM ORC

2022-09-21 Thread João Paulo Labegalini de Carvalho
Hi all, I am working on a project with LLVM ORC that led us to PostgreSQL as a target application. We were surprised by learning that PGSQL already uses LLVM ORC to JIT certain queries. I would love to know what motivated this feature and for what it is being currently used for, as it is not enab