Re: LLVM 22

From: Anthonin Bonnefoy <anthonin(dot)bonnefoy(at)datadoghq(dot)com>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Matheus Alcantara <matheusssilv97(at)gmail(dot)com>
Subject: Re: LLVM 22
Date: 2026-01-14 16:12:45
Message-ID: CAO6_XqoH-6HBmrFZrRXQuc+_PvkMYDxXcbLW+fsUfTnUnMi2mA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I've tried to generate multiple bitcode for a simple 'select aid % 2
FROM pgbench_accounts limit 10;' query. To keep bitcode simple, I've
modified the passes to use "default<O0>,mem2reg,inline" when we have
JIT inline without optimization (as described in [0]). I've tried the
following
- LLVM21: With lifetime
- LLVM21: Without lifetime
- LLVM22: With Poison
- LLVM22: Without Poison

In the 4 scenarios, the generated bc were the same with the exact same
instructions. Removing the lifetime end or the poison value doesn't
seem to change anything at this level of optimisation.

I'm not sure how to interpret this. Maybe the test is incorrect and a
different function needs to be called to possibly trigger the issue?
Or the poison/lifetime is only useful when going through the O3
optimisation pass?

[0]: https://www.postgresql.org/message-id/CAO6_XqrNjJnbn15ctPv7o4yEAT9fWa-dK15RSyun6QNw9YDtKg%40mail.gmail.com

Attachment Content-Type Size
21_lifetime.s application/octet-stream 4.1 KB
22_no_poisoned.s application/octet-stream 4.0 KB
22_poisoned.s application/octet-stream 4.0 KB
21_no_lifetime.s application/octet-stream 4.1 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Japin Li 2026-01-14 16:19:33 Re: Add IS_INDEX macro to brin and gist index
Previous Message Roman Khapov 2026-01-14 16:12:04 Re: GIN pageinspect support for entry tree and posting tree